Demonstration-Guided Deep Reinforcement Learning of Control Policies for Dexterous Human-Robot Interaction
Sammy Christen Stefan Stevsic Otmar Hilliges




Artificial Intelligence Enhances the Performance of Chaos-based Wireless Communication
    Celso Grebogi
    Received: date / Revised version: date
======================================================================================

empty
empty







In this paper, we propose a method for training control policies for human-robot interactions such as handshakes or hand claps via Deep Reinforcement Learning.

The policy controls a humanoid Shadow Dexterous Hand, attached to a robot arm. 

We propose a parameterizable multi-objective reward function that allows learning of a variety of interactions without changing the reward structure. 

The parameters of the reward function are estimated directly from motion capture data of human-human interactions in order to produce policies that are perceived as being natural and human-like by observers. 

We evaluate our method on three significantly different hand interactions: handshake, hand clap and finger touch. 

We provide detailed analysis of the proposed reward function and the resulting policies and conduct a large-scale user study, indicating that our policy produces natural looking motions.









§ INTRODUCTION



Dexterous humanoid hands, such as the Shadow Dexterous Hand <cit.>, are becoming very sophisticated. Improvements in mechatronics have enabled very compact systems that have more than twenty degrees of freedom (DoF). However, controller design remains very challenging and has been shown to be a very complex problem <cit.>. Recently, model-free deep reinforcement learning (DRL) algorithms have been applied to the control of humanoid hands, albeit on relatively simple tasks such as grasping or door opening <cit.> and in simulation only. 
In <cit.>, a controller trained in simulation has been transferred to a real humanoid hand. This opens up the door to learn policies for natural physical human-robot interactions. In particular, we are interested in learning a control policy for diverse hand interactions, such as handshakes or hand claps. The handshake is the most common greeting gesture throughout the world, therefore it has received a lot of attention in the robotics community <cit.>. In this paper, we present a method for training a control policy for human-robot hand interactions, using data from human demonstrations in combination with deep reinforcement learning. We test our method on the simulated model of the Shadow Dexterous Hand.


















To train a control policy using a DRL algorithm, one of the main issues is the definition of a reward function. For simple tasks, like grasping or pick and place tasks, the goal is obvious and the reward can be easily shaped. For our task, however, it is not obvious how to shape a reward function. The reward needs to result in motions that are perceived as natural, the hand needs to reach a desired contact profile and precise position, while dealing with complex contact dynamics.





To produce natural looking motions of animated characters in <cit.>, the reward  is based on tracking position and angle references from motion capture data. However, the authors only consider motions in open space and hence their reward function cannot be transfered to our task. 
Thus, we investigate important terms to construct a reward function and compare the influence of different reward terms in an ablation study.  





To enable generalization to different hand interactions, we define a parametrized reward function. 

We extract most of the reward function parameters from motion capture data, leading to only six parameters that are relatively easy to adjust. 
One could argue that the policy could be learned directly from data via Inverse Reinforcement Learning (IRL). However, state-of-the-art IRL methods <cit.> have not been applied to tasks that require precise positioning or challenging contact dynamics. Furthermore, these methods can be unstable when applied to motion capture data <cit.>.  



To ensure training convergence, we propose a specialized training method. Standard DRL algorithms work out of the box on benchmark problems <cit.>, but for more complex problems additional training details, such as randomization or early stopping are important <cit.>.
We propose a training method which works in combination with DDPG, resulting in stable convergence properties.








 































This work presents a method for learning control policies for dexterous human-robot interaction. More specifically, we contribute the following:
[(i)]
	
  * A multi-objective reward function for DRL algorithms. We show how reward function parameters are extracted from motion capture data and provide detailed analysis of how different parts of the reward influence the resulting control policy. 
	
  * A training method which works in combination with standard DRL algorithms.
	
  * A dataset of human hand interactions. 
	
  * A large-scale user study showing that adding imitation reward to the policy results in motions that are perceived as more natural. 


 






§ RELATED WORK




 §.§ Human Hand Interaction


Different aspects of the human-robot handshake problem were investigated in the robotics community, e.g., force properties of a human handshake <cit.>, the possibility to recognize personality and gender from a handshake <cit.>, or the design of a compliant controller for handshakes <cit.>.
Previous work mostly focuses on the handshake properties after the contact phase. However, producing a handshake movement is equally important <cit.>. When humans establish a handshake, one person requests the handshake by holding out one hand, while the other person responds by grabbing the hand <cit.>. Based on this observation, <cit.> tries to model the appropriate time to request a handshake.







To achieve a handshake with humanoid hands, usually the robot requests the handshake and closes the fingers when the human hand is in contact <cit.>. To the best of our knowledge, our method is the first that treats the problem in the case where the human requests the handshake. This case is harder from a control perspective, because it requires coordination with the human hand, the robot needs to produce natural looking motions and it still involves physical contact as in the previous case. The control of robotic arm movement is investigated in <cit.>, but these papers do not control humanoid hands and do not observe complex contact dynamics. Furthermore, we investigate the possibility of performing different hand interactions, such as hand claps or finger touches, which are relatively under-researched.





 §.§ Control of Dexterous Humanoid Hands


Dexterous humanoid hands are a highly complex mechanical systems <cit.>. Due to their high complexity, the control problem is shown to be very challenging <cit.>. Most approaches therefore use trajectory optimization to provide a controller <cit.>. These approaches require a precise model of the system, which makes them hard to transfer to real robots.
Leveraging real robot data for model learning was proposed in <cit.>, but the method is limited to slow in-hand manipulation of a pole. Contrary, model-free DRL does not require a model of the robot dynamics, i.e., all information is obtained through multiple episodes of trial-and-error. The only input to the algorithm is a reward function. Recently, model-free DRL has been applied to the control problem of humanoid hands <cit.>,  achieving impressive results in a simulated environment. Furthermore, <cit.> demonstrates the possibility of transferring a policy trained in simulation to the real Shadow Dexterous Hand. 




For non-linear control tasks, model-free DRL algorithms have shown impressive performance <cit.> on the OpenAI gym benchmark problems <cit.>. Furthermore, when applied to low degree of freedom robotic manipulators (7-10 DoF), like robotic hands with grippers, model-free DRL has been leveraged successfully <cit.>. However, the problem becomes more challenging when DRL is applied to systems with higher DoF. A hand control problem <cit.> or natural movement character control problem <cit.> deal with such systems. 
In <cit.>, the authors carefully design and adjust the weights of the reward to achieve the desired performance. 
To improve convergence properties, the authors use two training techniques: setting the initial state on the demonstration trajectory and early stopping. 
Human demonstration can be used to accelerate the convergence rate <cit.>. In <cit.>, a human operator provides demonstrations via teleoperation, which are used to initialize the policy. 
Alternatively, IRL methods <cit.> can learn the reward function from demonstration data. However, they require running the RL algorithm in the inner loop of an iterative method, which is not feasible with DRL algorithms. To overcome this issue, IRL is posed as an adversarial imitation problem <cit.>, but these methods are prone to instability.















Our method is inspired by previous DRL approaches, but our task requires significant changes of existing methods. In <cit.>, the demonstrations are provided by teleoperating a simulated robot hand, operating in isolation. 
For our case, it is impractical to collect demonstrations this way because it requires interactions between two humans. Thus, we capture real interactions using a motion capture system. 

Our method is more similar to <cit.>, which is not designed for humanoid hands. 
In <cit.>, the authors use motion capture data directly in the reward function formulation. Contrary, we extract the final pose parameters from data, while we similarly use motion capture data to produce natural looking motions. Additionally, we add contact patterns as an objective to the reward function, and provide a different training method.  

 


 










 












§ PRELIMINARIES




 §.§ Deep Reinforcement Learning
















Our control problem can be formalized using Markov Decision Processes (MDP), defined as a tuple = {, , ℛ, 𝒯, ρ_0, }. We describe an environment with a set of states , a set of actions , a reward function ℛ = (t, t), transition dynamics 𝒯 = p(t+1|t, t), an initial state distribution ρ_0 = p(1) and a discount rate ∈ [0,1], where t∈ and t∈. Model-free RL does not require knowledge of transition dynamics and requires only sampling from the transition dynamics probability distribution.  
We define the return R_t as a discounted sum of future rewards:

    R_t = ∑_i=t^T^i-t(i, i).

The controller is defined as a control policy , which maps states to actions : →. The goal of the reinforcement learning algorithm is to learn a policy  which maximizes the expected return from the start distribution:

    = 𝔼_ [R_1 ]


We define the action-value or Q-function, which describes the expected return under a policy  when taking action t from state t, also called state-action pair, as follows: 

    Q(t, t) = 𝔼_ [ R_t|t, t ].


To solve the given problem, we define the Q-function and policy as neural network function approximators parametrized with θ^Q and θ^. This is known as an actor-critic type of RL algorithm, since we learn both an actor function, i.e., the policy, and a critic function, i.e., the Q-function. More specifically, we use the DDPG algorithm <cit.> to compute the gradients for updating the neural network parameters. To update  θ^Q, we minimize the loss:

    L(θ^Q) = 𝔼_, t [ ( Q(t, t ; θ^Q) - y_t )^2   ] 
       y_t = (t, t) +  Q(t+1, t+1 ; θ^Q)
 
To update the actor parameters θ^, we compute the gradients:

    ∇_θ^ = 𝔼_ [∇_θ^ Q(t, t ; θ^Q)    |t, t = (t ; θ^)  ],

which are applied to the actor neural network. For both networks we use three fully connected layers with 256 neurons and ReLu activation functions.

To ensure convergence of the policy, we apply all techniques from the DDPG paper to stabilize convergence properties. This includes a replay buffer, batch normalization and target networks. DDPG is an off-policy algorithm, thus we define the exploration policy as:

    t = (t) + 𝒩,

where 𝒩 is a sample from zero mean Normal distribution. More implementation details can be found in <cit.>.
















 §.§ Simulation Environment




Our simulation environment consist of two robots: the agent, controlled by the policy, and the target hand. The agent consists of a 4 DoF robotic arm and the Shadow Dexterous Hand with 24 DoF. The Shadow Dexterous Hand is controlled by 20 actuators (cf. Fig. <ref>). We use the same hand model as stand-in for a human hand for convenience, since this model is easy to pose in different configurations. However, this model can be replaced with a human hand model, which should not influence the results of our experiments since the hand is not actuated, as usually assumed for a hand requesting an interaction <cit.>. The robot models are taken from the OpenAI gym framework <cit.>. 


The input to the control policy are joint angles, joint velocities and contact sensor readings (cf. Fig. <ref>) of the agent hand. Additional inputs are the positions of the target hand links and the origin of each rigid body on the hand. The policy outputs are control signals that actuate the agent's arm and hand. Control signals are setpoints for the joint angles scaled in the range from -1.0 to 1.0. 




§ METHOD


Our method is able to learn control policies of hand interactions using motion capture data of human demonstrations. We assume the following setting: the first participant requests the interaction while the second is executing the interaction sequence. In the example of a handshake, the first participant stretches out the hand to request the handshake, while the other responds by grabbing the hand. The robot learns to perform the behavior of the second participant. The goal is to produce the desired interaction and motions perceived as natural. 
We propose a single reward function that can be applied to various hand interactions. 

The parameters of the reward function are extracted directly from the motion capture dataset using Alg. <ref>. The policy is trained via a DDPG based training method, as explained in Sec. <ref>.












 §.§ Reward Function




Our proposed reward function consists of two terms:

    (t, t) = _F(t, t) + _I(t, t),

where _F(t, t) is the final state reward, which is used to reward the correct end configuration, and  the imitation state reward _I(t, t), which provides trajectory guidance to make the interactions look more natural.

The final state reward itself consists of four terms:

    _F(t, t) = _p(t) + _α(t) + _c(t) + _a(t),

where _p(t) is a position reward, _α(t) is an angle reward, _c(t) is a contact reward, and _a(t) penalizes high action inputs. Experimentally, we determined that the most important position features are the fingertip positions of the agent hand (total number N_f = 5). Regarding the angles, we use all joint angles of the robot hand to compute the angle reward (total number N_α = 24). Position and angle rewards are defined as a negative l_2 norm of position features and angle errors:

    _p(t) = - ∑_i=1^N_fω^i_p  || p^i_g - p^i_rt||
       _α(t) = - ∑_i=1^N_αω^i_α||α^i_g - α^i_rt||.

The vector p^i_g is the goal position of each position feature and p^i_rt is the current position of the respective feature. Similarly, α^i_g is the goal joint angle and α^i_rt the current joint angle on the robot hand. The weights ω^i_p, ω^i_α determine the importance of the specific goal, which we define via algorithm described in Sec. <ref>. When using only position and angle rewards, the robot hand only roughly reaches the desired end configuration (cf. Fig <ref>, Baseline 2). 
Our task requires accurate hand positioning, which is hard to achieve in tasks that involve contacts.
We achieve the desired hand position by adding a contact reward _c(t), which forces the desired contact profile.

For more details about the influence of the reward terms we refer to Sec. <ref>.
Additionally, a control input reward is added to prevent high control signals. Contact and input rewards are defined as:

    _c(t) = ∑_i=1^N_c^i_c    ,
       _a(t) = - ∑_i=1^N_a^i_a  || a^i ||^2    ,

where the indicator function  outputs 1 in case the contact sensor is active and 0 otherwise. The weight ^i_c determines the importance of each contact sensor. The system has N_c = 15 contact sensors. a^i is the control input signal for each actuator and ^i_a is the respective weight. The system has N_a = 24 control inputs.






The imitation reward consist of two further terms:

    _I(t, t) = _p I(t) + _α I(t).

The difference compared to the final state reward is that the goal position p^i_g t and goal angles α^i_g t depend on the timestep:

    _p I(t) = - K_p I∑_i=1^N_fω^i_p|| p^i_g t - p^i_r ||   ,
       _α I(t) = - K_α I∑_i=1^N_αω^i_α||α^i_gt - α^i_r ||.

These rewards are scaled with the weights K_p I and K_α I.



The final state reward function is often enough to complete the interaction, i.e., to reach the final pose. However, the most direct trajectory often does not look natural (cf. Fig. <ref>). 

We overcome this issue by adding an imitation reward. As shown in Sec. <ref>, imitation reward significantly improves that the hand motion is perceived as natural.
However, when the starting hand pose is far away from poses in demonstration examples, the policy may produce non-smooth motions. We evaluate these examples also in Sec. <ref>.

 



  §.§.§ Reward function parameters


To define the terms of the reward function, we use a  motion capture dataset = {(p^i_t, p^j_t, α^i_t, α^j_t) }_t=1^T of an interaction sequence. The dataset provides positions of rigid bodies p^i_t, p^j_t and joint angles α^i_t, α^j_t of two human hand models at timestep t: the target hand, denoted with superscript j, which requests the interaction and the actor hand, denoted with superscript i, which the robot imitates. From , we can calculate distances between the rigid bodies d^ij_t and the relative position calculated in the coordinate frame of the target hand body Δ  p^ij_t. 
We use fingertip positions on both hands, plus the palm position on the target hand. For the joint angles, we use all joints from the human data that have a corresponding joint on the robot hand. Based on the minimum distance, we set the reference frame j_min and reference timestep t_min, as shown in Alg. <ref>.  Using these references, we compute the goal positions and goal angles. 

The position goals are defined in a goal centric way, which enables us to calculate them for a randomly positioned hand in the simulation p^j_s, as shown in line 5 of Alg. <ref>, where R^j_s is the rotation matrix of the target hand rigid body with index j.





Position weights are calculated using the equation:

    ω^i_p = K_p d_min/d_t_min^ij_min.

The angle and control weights all have the same value ω_α^i = K_α,  ^i_a = K_a.
We set the contact weights ^i_c to K_c for all sensors that should be in contact. This can be done by asking participants where they feel the pressure during interactions. Alternatively, one could use the method from <cit.>, which simply applies color to the target hand and measures contact area from paint marks. 

To train the policy, we need to set just six weights in the reward function (K_p, K_α, K_c, K_a, K_p I, K_α I). In all our experiments, K_a is set to 1, while K_c is roughly set to N_o/5, where N_o is the number of sensors that should be in contact.






















 §.§ Training
 


To train the policy, we first need to position the target hand. For a single training episode, the target hand stays fixed. Although we train the policy with a static hand, we experimentally show that our policy generalizes to moving hands (cf. <ref>). The joint angles of the target hand are set according to the joints of the human target hand at a timestep which occurs prior to the interaction timestep t_min. This ensures that the target hand is not closed, thus allowing the robot to interact. Our reward function is defined in a goal centric way. This enables randomization of the target hand position, performed at the beginning of each episode. 

To calculate the reward function parameters, we pick an interaction sequence uniformly at random.



















We randomize the robot hand position additionally to target hand randomization. For imitation reward to be effective, the robot hand should be positioned in the same configuration as the human hand at the start of the imitation trajectory. Thus, we position the robot wrist to the position of the human wrist at timestep t_s, augmented with random Gaussian noise. The timestep t_s is selected uniformly at random from a set {t_k | k=1 .. (t_min - t_off)}. We use a small offset t_off because hands can collide in the last part of the trajectory. If this position is not reachable, we start from the closest reachable position. Contrary to <cit.>, we cannot position the agent exactly in the human pose because of the configuration differences of the human and robot arms. Furthermore, our task is driven by a goal pose, which means that starting only from demonstration trajectories, as in <cit.>, will result in poor generalization. After each N_e steps, we update the network using the DRL algorithm described in Sec. <ref>.



 §.§ Data Collection


To collect data, we use the OptiTrack motion capture system. Each participant is equipped with markers as shown in Fig. <ref>. We only track the right hand of each participant. 
Hand tracking is prone to marker mislabeling, with fingertip markers being most problematic. We use active markers, which can be uniquely identified by their blinking pattern, on the fingertips.
The OptriTrack software fits a model of the human hand to the markers, providing the position of each link and joint angle of the human hand. For each interaction, we recorded five demonstrations. We will release the dataset and simulation environment for further research (https://ait.ethz.ch/projects/2019/DRL-handshake/https://ait.ethz.ch/projects/2019/DRL-handshake/).















§ RESULTS


We conducted experiments in simulation to evaluate our method. We extensively test our policy on three different hand interactions: handshake, hand clap, and E.T. greeting (e.g. index finger touching), see Fig. <ref>. These three interactions are diverse: the handshake requires grasping of the target hand in a specific way, the hand clap has a characteristic motion prior to contact, while the E.T. greeting requires precise positioning of the index finger. 



 §.§ Ablation Study on Reward Function





In a first experiment, we intend to show the influence of the different parts of our reward function on the resulting control policy.
For this, we do an ablation study on our reward function.
We compare the full final state reward _F(t, t) with two baselines. Baseline 1 uses only the relative position of the palm instead of the fingertips as a goal position feature, while keeping angle, contact and input reward the same. In Baseline 2, we remove the contact reward from the reward function. Furthermore, we examine the influence of adding the imitation reward to the final state reward.  



 





Our final state reward function shows overall better performance than both baselines (c.f. Fig. <ref>). The influence of the position reward can be seen by comparing Baseline 2 to Baseline 1 for handshake and E.T. interactions. Although both baselines have low success rates, Baseline 2 results in final configurations closer to the desired ones as shown in Fig. <ref>. Adding contact reward to Baseline 2, i.e. using our reward function, removes these errors. The importance of the contact reward can be also seen in Fig. <ref> in case of the hand clap. Since precise positioning is less important here, Baseline 1 achieves high success rate because of the contact reward. After adding the imitation reward, we observe that the success rates do not significantly change.






















 §.§ Evaluation of Imitation Training


To qualitatively assess the impact of the imitation reward, we conduct a large-scale user study (N=116). We present 11 video sequences of policy outputs with and without imitation reward side-by-side . We keep the initial conditions for each sequence-pair the same and randomly assign videos to the left or right. The participants state which video is perceived as more natural on a forced alternative choice 5-point scale. The five responses are: "Left sequence looks much more natural", "Left sequence looks more natural", "Both the same", "Right sequence looks more natural", "Right sequence looks much more natural".
















Assuming equidistant intervals, we mapped user responses onto a scale from -2 to 2, where positive values mean that the user prefers the policy generated with imitation reward and vice versa. The imitation policy can generate non-smooth motions when the starting pose is far away from the recorded human trajectory. To evaluate these examples, we compare two sequences including obvious non-smooth motions.




Generally speaking, participants favor policies generated with imitation reward (c.f. Table <ref>). For hand claps, the differences are easy to spot (see Fig. <ref>). Hence, human raters strongly prefer the imitation based policy. For the handshake, the differences are harder to see, resulting in significant amount of participants selecting "Both the same" (15.2%). However, the majority of the participants still prefer the imitation based policy. 
For the E.T. interactions, there are no observable differences. Thus, the majority of participants answered with "Both the same" (54.3%).
For non-smooth handshakes, the results indicate that participants prefer smooth motions. However, for non-smooth hand claps, participants prefer imitation features, although the mean score is lower than in the case of smooth hand claps.












 











 §.§ Policy Evaluations



To evaluate the robustness of policies created with our method, we test the reaction to perturbations in orientation and velocity of the target hand. During training, we only randomize the position of the target hand, while the orientation stays the same. We position the target hand in the reachable workspace of the agent and measure the success rate, while changing the yaw and pitch angles of the target hand. In a realistic scenario, the human hand will not be perfectly still. Furthermore, the human can react when the contact is imminent by closing the hand or approaching the agent hand. Thus, we conduct a second experiment where the target hand is moving at constant speed, changing the direction at random every half second (see Fig. <ref>).




The experiments indicate that our method is robust to perturbations in orientation and velocity of the target hand. This shows that our reward function generates policies that generalize well to unseen scenarios. 

We also tested our policy with changing configurations of the target hand, i.e., closing fingers in a handshake policy, and did not observe any major changes. Demonstrations of these experiments can be seen in the accompanying video (https://youtu.be/ZSgEqyltaN4https://youtu.be/ZSgEqyltaN4).







§ DISCUSSION AND CONCLUSION


Control of dexterous humanoid hands is a challenging problem, especially when it involves contact dynamics. 

In this paper, we demonstrate that a single parametrized reward function can be used for different hand interactions. 

To define parameters of the reward function, we use a simple algorithm to extract parameters from motion capture data. 

We show that policies generated with our method produce more natural looking trajectories, and generalize well to different orientations and velocities of the target hand.


Our results are shown only in simulation and with a static target hand as an initial step towards natural human-robot hand interactions. To achieve this level of performance on a real robot, transfer learning methods, such as the one suggested in <cit.>, could be applied. 

We show that our policy reacts well to small velocity disturbances. However, humans can perform synchronous hand motions prior to interaction. This problem should be investigated in more detail. Our method only considers contacts, but we never investigated forces acting on the hand. <cit.> emphasizes the importance of forces applied during handshakes. According to our measurements, forces applied to the target hand are in the range of a normal handshake. 
Compliant behavior is important for hand interactions <cit.>. However, evaluation of the robot hand compliance  is outside the scope of our work.    





This paper shows how natural human-robot hand interaction can be learned using DRL. To the best of our knowledge, this is the first paper that uses a dexterous humanoid hand for human-robot hand interactions. This opens up the possibility to achieve natural hand interactions on a real humanoid robot.
















IEEEtran



















