## Learning to combine primitive skills: A step towards versatile robotic manipulation

Robin Strudel ∗ 1 , Alexander Pashevich ∗ 2 , Igor Kalevatykh , 1 Ivan Laptev , Josef Sivic 1 1 , Cordelia Schmid 2

Abstract -Manipulation tasks such as preparing a meal or assembling furniture remain highly challenging for robotics and vision. Traditional task and motion planning (TAMP) methods can solve complex tasks but require full state observability and are not adapted to dynamic scene changes. Recent learning methods can operate directly on visual inputs but typically require many demonstrations and/or task-specific reward engineering. In this work we aim to overcome previous limitations and propose a reinforcement learning (RL) approach to task planning that learns to combine primitive skills. First, compared to previous learning methods, our approach requires neither intermediate rewards nor complete task demonstrations during training. Second, we demonstrate the versatility of our vision-based task planning in challenging settings with temporary occlusions and dynamic scene changes. Third, we propose an efficient training of basic skills from few synthetic demonstrations by exploring recent CNN architectures and data augmentation. Notably, while all of our policies are learned on visual inputs in simulated environments, we demonstrate the successful transfer and high success rates when applying such policies to manipulation tasks on a real UR5 robotic arm.

## I. INTRODUCTION

In this work we consider visually guided robotics manipulations and aim to learn robust visuomotor control policies for particular tasks. Autonomous manipulations such as assembling IKEA furniture [1] remain highly challenging given the complexity of real environments as well as partial and uncertain observations provided by the sensors. Successful methods for task and motion planning (TAMP) [2]-[4] achieve impressive results for complex tasks but often rely on limiting assumptions such as the full state observability and known 3D shape models for manipulated objects. Moreover, TAMP methods usually complete planning before execution and are not robust to dynamic scene changes.

Recent learning methods aim to learn visuomotor control policies directly from image inputs. Imitation learning (IL) [5]-[8] is a supervised approach that can be used to learn simple skills from expert demonstrations. One drawback of IL is its difficulty to handle new states that have not been observed during demonstrations. While increasing the number of demonstrations helps to alleviate this issue, an exhaustive sampling of action sequences and scenarios becomes impractical for long and complex tasks.

In contrast, reinforcement learning (RL) requires little supervision and achieves excellent results for some challenging tasks [9], [10]. RL explores previously unseen scenarios and,

1 Inria, École normale supérieure, CNRS, PSL Research University, 75005 Paris, France.

2 University Grenoble Alpes, Inria, CNRS, Grenoble INP, LJK, 38000 Grenoble, France.

∗ Equal contribution.

hence, can generalize beyond expert demonstrations. As full exploration is exponentially hard and becomes impractical for problems with long horizons, RL often relies on careful engineering of rewards designed for specific tasks.

Common tasks such as preparing food or assembling furniture require long sequences of steps composed of many different actions. Such tasks have long horizons and, hence, are difficult to solve by either RL or IL methods alone. To address this issue, we propose a RL-based method that learns to combine simple imitation-based policies. Our approach simplifies RL by reducing its exploration to sequences with a limited number of primitive actions, that we call skills .

Given a set of pre-trained skills such as "grasp a cube" or "pour from a cup", we train RL with sparse binary rewards corresponding to the correct/incorrect execution of the full task. While hierarchical policies have been proposed in the past [11], [12], our approach can learn composite manipulations using no intermediate rewards and no demonstrations of full tasks . Hence, the proposed method can be directly applied to learn new tasks. See Figure 1 for an overview of our approach.

Our skills are low-level visuomotor controllers learned from synthetic demonstrated trajectories with behavioral cloning (BC) [5]. Examples of skills include go to the bowl , grasp the object , pour from the held object , release the held object , etc. We automatically generate expert synthetic demonstrations and learn corresponding skills in simulated environments. We also minimize the number of required demonstrations by choosing appropriate CNN architectures and data augmentation methods. Our approach is shown to compare favorably to the state of the art [7] on the FetchPickPlace test environment [13]. Moreover, using recent techniques for domain adaptation [14] we demonstrate the successful transfer and high accuracy of our sumulator-trained policies when tested on a real robot

We compare our approach with two classical methods: (a) an open-loop controller estimating object positions and applying a standard motion planner (b) a closed-loop controller adapting the control to re-estimated object positions. We show the robustness of our approach to a variety of perturbations. The perturbations include dynamic change of object positions, new object instances and temporary object occlusions. The versatility of learned policies comes from both the reactivity of the BC learned skills and the ability of the RL master policy to re-plan in case of failure. Our approach allows to compute adaptive control and planning in real-time.

In summary, this work makes the following contributions. (i) We propose to learn robust RL policies that combine BC

skills to solve composite tasks. (ii) We present sample efficient training of BC skills and demonstrate an improvement compared to the state of the art. (iii) We demonstrate successful learning of relatively complex manipulation tasks with neither intermediate rewards nor full demonstrations. (iv) We successfully transfer and execute policies learned in simulation to real robot setups. (v) We show successful task completion in the presence of perturbations.

Our simulation environments together with the code and models used in this work is publicly available at https: //www.di.ens.fr/willow/research/rlbc/ .

## II. RELATED WORK

Our work is related to robotics manipulation such as grasping [15], opening doors [16], screwing the cap of a bottle [17] and cube stacking [18]. Such tasks have been addressed by various methods including imitation learning (IL) [19] and reinforcement learning (RL) [20].

Imitation learning (IL). A neural network is trained to solve a task by observing demonstrations. Approaches include behavioral cloning (BC) [5] and inverse reinforcement learning [8]. BC learns a function that maps states to expert actions [6], [7], whereas inverse reinforcement learning learns a reward function from demonstrations in order to solve the task with RL [18], [21], [22]. BC typically requires a large number of demonstrations and has issues with not observed trajectories. While these problems might be solved with additional expert supervision [6] or noise injection in expert demonstrations [23], we address them by improving the standard BC framework. We use recent state-of-the-art CNN architectures and data augmentation for expert trajectories. This permits to significantly reduce the number of required demonstrations and to improve performance.

Reinforcement learning (RL). RL learns to solve a tasks without demonstrations using exploration. Despite impressive results in several domains [9], [10], [16], [24], RL methods show limited capabilities when operating in complex and sparse-reward environments common in robotics. Moreover, RL methods typically require prohibitively large amounts of interactions with the environment during training. Hierarchical RL (HRL) methods alleviate some of these problems by learning a high-level policy modulating low-level workers. HRL approaches are generally based either on options [25] or a feudal framework [26]. The option methods learn a master policy that switches between separate skill policies [27]-[30]. The feudal approaches learn a master policy that modulates a low-level policy by a control signal [31]-[35]. Our approach is based on options but in contrast to the cited methods, we pretrain the skills with IL. This allows us to solve complex and sparse reward problems using significantly less interactions with the environment during training.

Combining RL and IL. A number of approaches combining RL and IL have been introduced recently. Gao et al. [36] use demonstrations to initialize the RL agent. [37], [38] use RL to improve expert demonstrations, but do not learn hierarchical policies. Demonstrations have been also used to define RL objective functions [39], [40] and rewards [41]. Das et al. [11] combines IL and RL to learn a hierarchical policy. Unlike our method, however, [11] requires full task demonstrations and task-specific reward engineering. Moreover, the addressed navigation problem in [11] has a much lower time horizon compared to our tasks. [11] also relies on pre-trained CNN representations which limits its application domain. Le at al. [12] train low-level skills with RL, while using demonstrations to switch between skills. In a reverse manner, we use IL to learn low-level control and then deploy RL to find appropriate sequences of pre-trained skills. The advantage is that our method can learn a variety of complex manipulations without full task demonstrations. Moreover, [11], [12] learn discrete actions and cannot be directly applied to robotics manipulations that require continous control.

In summary, none of the methods [11], [12], [37], [38] is directly suitable for learning complex robotic manipulations due to requirements of dense rewards [11], [38] and state inputs [37], [38], limitations to short horizons and discrete actions [11], [12], the requirement of full task demonstrations [11], [12], [37], [38] and the lack of learning of visual representations [11], [37], [38]. Moreover, our skills learned from synthetic demonstrated trajectories outperform RL based methods, see Section V-D.

## III. APPROACH

Our RLBC approach aims to learn multi-step policies by combining reinforcement learning (RL) and pre-trained skills obtained with behavioral cloning (BC). We present BC and RLBC in Sections III-A and III-B. Implementation details are given in Section III-C.

## A. Skill learning with behavioral cloning

Our first goal is to learn basic skills that can be composed into more complex policies. Given observation-action pairs D = { ( o , a t t ) } along expert trajectories, we follow the behavioral cloning approach [5] and learn a function approximating the conditional distribution of the expert policy π E ( a t | o t ) controlling a robot arm. Our observations o t ∈ O = R H × W M × are sequences of the last M depth frames. Actions a t = ( v t , ω t , g t ) , a t ∈ A BC are defined by the end-effector linear velocity v t ∈ R 3 and angular velocity ω t ∈ R 3 as well as the gripper openness state g t ∈ { 0 1 , } .

We learn the deterministic skill policies π s : O → A BC approximating the expert policy π E. Given observations o t with corresponding expert (ground truth) actions a t = ( v t , ω t , g t ) , we represent π s with a convolutional neural network (CNN) and learn network parameters ( θ, η ) such that predicted actions π s ( o t ) = ( ˆ v t , ˆ ω t , g ˆ) t minimize the loss L BC ( π s ( o t ) , a t ) = λ ∥ ∥ [ ˆ v t , ˆ ω t ] -[ v t , ω t ] ∥ ∥ 2 2 + (1 -λ ) ( g t log ˆ + (1 g t -g t ) log (1 -ˆ) g t ) , where λ ∈ [0 , 1] is a scaling factor which we empirically set to 0.9.

Our network architecture is presented in Figure 1(right). When training a skill policy π i s , such as reaching, grasping or pouring, we condition the network on the skill using the recent FiLM architecture [42]. Given the one-hot encoding s i of a skill i , we use s i as input to the FiLM generator which performs affine transformations of the network feature maps. FiLM conditions the network on performing a given skill, which permits learning a shared representation for all skills. Given an observation o t , the network CNN θ s ( | i ) generates a

Fig. 1: Illustration of our approach. (Left): Temporal hierarchy of master and skill policies. The master policy π m is executed at a coarse interval of n time-steps to select among K skill policies π 1 s . . . π K s . Each skill policy generates control for a primitive action such as grasping or pouring . (Right): CNN architecture used for the skill and master policies.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-738d5cab-058a-4b2c-a662-488aa064384c.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-b336c98f-a7c9-4711-ab4e-f27453f4bbce.jpg)

feature map x i t conditioned on skill i . The spatially-averaged x i is linearly mapped with FC η ( ) to the action of π i s .

## Algorithm 1 RLBC

## B. RLBC approach

We wish to solve composite manipulations without full expert demonstrations and with a single sparse reward. For this purpose we rely on a high-level master policy π m controlling the pre-trained skill policies π s at a coarse timescale. To learn π m , we follow the standard formulation of reinforcement learning and maximize the expected return E π ∑ ∞ k =0 γ k r t + k given rewards r t . Our reward function is sparse and returns 1 upon successful termination of the task and 0 otherwise. The RL master policy π m : O × A RL → [0 , 1] chooses one of the K skill policies to execute the low-level control, i.e., the action space of π m is discrete: A RL = { 1 , . . . , K } . Note, that our sparse reward function makes the learning of deep visual representations challenging. We, therefore, train π m using visual features x i t obtained from the BC pretrained CNN θ s ( | i ) . Given an observation o t , we use the concatenation of skill-conditioned features { x , . . . , x 1 t K t } as input for the master CNN µ ( ) , see Figure 1(right).

To solve composite tasks with sparse rewards, we use a coarse timescale for the master policy. The selected skill policy controls the robot for n consecutive time-steps before the master policy is activated again to choose a new skill. This allows the master to focus on high-level task planning rather than low-level motion planning achieved by the skills. We expect the master policy to recover from unexpected events, for example, if an object slips out of a gripper, by re-activating an appropriate skill policy. Our combination of the master and skill policies is illustrated in Figure 1(left).

RLBC algorithm. The pseudo-code for the proposed approach is shown in Algorithm 1. The algorithm can be divided into three main steps. First, we collect a dataset of expert trajectories D k for each skill policy π k s . For each policy, we use an expert script that has an access to the full state of the environment. Next, we train a set of skill policies { π , . . . , π 1 s K s } . We sample a batch of state-action pairs and update parameters of convolutional layers θ and the skills linear layer parameters η . Finally, we learn the master π m using the pretrained skill policies and the frozen parameters θ . We collect episode rollouts by first choosing a skill policy with the master and then applying the selected skill to the environment for n time-steps. We update the master policy weights µ to maximize the expected sum of rewards.

1: *** Collect expert data *** 2: for k ∈ { 1 , . . . , K } do 3: Collect an expert dataset D k for the skill policy π k s 4: *** Train { π , . . . , π 1 s K s } by solving: *** 5: θ, η = arg min θ,η ∑ K k =1 ∑ ( o ,a t t ) ∈D k L BC ( π k s ( o t ) , a t ) 6: while task is not solved do 7: *** Collect data for the master policy *** 8: E = {} glyph[triangleright] Empty storage for rollouts 9: for episode\_id ∈ { 1 , . . . , ppo\_num\_episodes } do 10: o 0 = new\_episode\_observation () 11: t = 0 12: while episode is not terminated do 13: k t ∼ π m ( o t ) glyph[triangleright] Choose the skill policy 14: o t + n , r t + n = perform\_skill ( π k t s , o t ) 15: t = t + n 16: E = E ∪ { ( o 0 , k 1 , r 1 , o 1 , k 2 , r 2 , o 2 , . . . ) } 17: *** Make a PPO step for the master policy on E *** 18: µ = ppo\_update ( π m , E )

## C. Approach details

Skill learning with BC. We use ResNet-18 for the CNN θ s ( | i ) , which we compare to VGG16 and ResNet-101 in Section V-A. We augment input depth frames with random translations, rotations and crops. We also perform viewpoint augmentation and sample the camera positions on a section of a sphere centered on the robot and with a radius of 1 40 . m. We uniformly sample the yaw angle in [ -15 ◦ , 15 ] ◦ , the pitch angle in [15 ◦ , 30 ] ◦ , and the distance to the robot base in [1 35 . , 1 50] . m. The impact of both augmentations is evaluated in Section V-B. We normalize the ground truth of the expert actions to have zero mean and a unit variance and normalize the depth values of input frames to [ -1 1] , . We learn BC skills using Adam [43] with the learning rate 10 -3 and a batch size 64. We also use Batch Normalization [44].

Task learning with RL. We learn the master policies with the PPO [45] algorithm using the open-source implementation [46] where we set the entropy coefficient to 0.05, the value loss coefficient to 1, and use 8 episode rollouts for the PPO update. For the RLBC method, the concatenated skill features { x , . . . , x 1 t K t } are processed with the master network CNN µ ( ) having 2 convolutional layers with 64 filters of size 3 × 3 . During pre-training of skill policies we update the parameters ( θ, η ) . When training the master policy, we only update µ while keeping ( θ , η ) parameters fixed. We train RLBC using 8 different random seeds in parallel and evaluate the best one.

Real robot transfer. To apply our method on the real robot, we use a state-of-the-art technique of learning sim2real transfer based on data augmentation with domain randomization [14]. This method uses a proxy task of cube position prediction and a set of basic image transformations to learn a sim2real data augmentation function for depth images. We augment the depth frames from synthetic expert demonstrations with this method and, then, train skill policies. Once the skill policy is trained on these augmented simulation images, it is directly used on the real robot.

## IV. EXPERIMENTAL SETUP

This section describes the setup used to evaluate our approach. First, we present the robot environment and the different tasks in Sections IV-A and IV-B. Next, we describe the synthetic dataset generation and skill definition for each task in Sections IV-C and IV-D.

## A. Robot and agent environment

For our experiments we use a 6-DoF UR5 robotic arm with a 3 finger Robotiq gripper, see Figure 2. In simulation, we model the robot with the pybullet physics simulator [47]. For observation, we record depth images with the Microsoft Kinect 2 placed in front of the arm. The agent takes as input the three last depth frames o t ∈ R 224 × 224 × 3 and commands the robot with an action a t ∈ R 7 . The control is performed at 10 Hz frequency.

## B. UR5 tasks

For evaluation, we consider 3 tasks: UR5-Pick, UR5-Bowl and UR5-Breakfast. The UR5-Pick task picks up a cube of a size between 3.5 cm and 8.0 cm and lifts it up, see Figure 2a. In UR5-Bowl the robot has to grasp the cube and place it in the bowl, see Figure 2b. The UR5-Breakfast task contains a cup, a bottle and a bowl as shown in Figure 2c. We use distinct ShapeNet [48] object instances for the training and test sets (27 bottles, 17 cups, 32 bowls in each set). The robot needs to pour ingredients from the cup and the bottle in the bowl. In all tasks, the reward is positive if and only if the task goal is reached. The maximum episode lengths are 200, 600, and 2000 time-steps for UR5-Pick, UR5-Bowl, and UR5-Breakfast correspondingly.

## C. Synthetic datasets

We use the simulated environments to create a synthetic training and test set. For all our experiments, we collect trajectories with random initial configurations where the objects and the end-effector are allocated within a workspace of 80 × 40 × 20 cm . 3 The synthetic demonstrations are collected using an expert script designed for each skill. The script has access to the full state of the system including the states of the robot and the objects. To generate synthetic demonstrations, we program end-effector trajectories and use inverse kinematics (IK) to generate corresponding trajectories in the robot joints space. Each demonstration consists of multiple pairs of the three last camera observations and the robot control command performed by the expert script. For UR5-Pick, we collect 1000 synthetic demonstrated trajectories for training. For UR5-Bowl and UR5-Breakfast, we collect a training dataset of 250 synthetic demonstrations. For evaluation of each task, we use 100 different initial configurations in simulation and 20 trials on the real robot.

TABLE I: Evaluation of BC skills trained with different CNN architectures and number of demonstrations on the UR5-Pick task in simulation.

|   Demos | VGG16-BN   | ResNet-18   | ResNet-101   |
|---------|------------|-------------|--------------|
|      20 | 1%         | 1%          | 0%           |
|      50 | 9%         | 5%          | 5%           |
|     100 | 37%        | 65%         | 86%          |
|    1000 | 95%        | 100%        | 100%         |

TABLE II: Evaluation of ResNet-18 BC skills trained with different data augmentations on UR5-Pick task in simulation.

|   Demos | None   | Standard   | Viewpoint   | Standard & Viewpoint   |
|---------|--------|------------|-------------|------------------------|
|      20 | 1%     | 49%        | 39%         | 75%                    |
|      50 | 5%     | 81%        | 79%         | 93%                    |
|     100 | 65%    | 97%        | 100%        | 100%                   |

## D. Skill definition

UR5-Pick task is defined as a single skill. For UR5-Bowl and UR5-Breakfast, we consider a set of skills defined by expert scripts. For UR5-Bowl, we define four skills: (a) go to the the cube, (b) go down and grasp, (c) go up, and (d) go to the bowl and open the gripper. For UR5-Breakfast, we define four skills: (a) go to the bottle, (b) go to the cup, (c) grasp an object and pour it to the bowl, and (d) release the held object. We emphasize that the expert dataset does not contain full task demonstrations and that all our training is done in simulation. When training the RL master, we execute selected skills for 60 consecutive time-steps for the UR5-Bowl task and 220 time-steps for the UR5-Breakfast task.

## V. EVALUATION OF BC SKILL LEARNING

This section evaluates the different parameters of the BC skill training for the UR5-Pick task and a comparison with the state of the art. First, we evaluate the impact of the CNN architecture and data augmentation on the skill performance in Sections V-A and V-B. Then, we show that the learned policies transfer to a real-robot in Section V-C. Finally, we compare the BC skills with the state of the art in Section V-D.

## A. CNN architecture for BC skill learning

Given the simulated UR5-Pick task illustrated in Figure 2a(left), we compare BC skill networks trained with different CNN architectures and varying number of expert demonstrations. Table I compares the success rates of policies with VGG and ResNet architectures. Policies based on the VGG architecture [49] obtain success rate below 40% with 100 training demonstrations and reach 95% with 1000 demonstrations. ResNet [50] based policies have a success rate above 60% when trained on a dataset of 100 demonstrations and reach 100% with 1000 demonstrations. Overall ResNet101 has the best performance closely followed by ResNet-18 and outperforms VGG significantly. To conclude, we find that the network architecture has a fundamental impact on the BC performance. In the following experiments we use ResNet18 as it presents a good trade-off between performance and training time.

When examining why VGG-based BC has a lower success rate, we observe that it has higher validation errors compared to ResNet. This indicates that VGG performs worse on the

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-1a39a5ff-b3f3-4ee2-b2d1-958e2a320309.jpg)

(a) UR5-Pick

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-8a2973e5-8dbd-4407-8792-6028702dd88e.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-6ef9afe9-61dd-4588-9416-75ca0abd84aa.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-b294db60-60e7-49a4-9505-20f8519e39b7.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-388d8d07-bb5f-438a-b5ca-f0eea9c3bed0.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-e467f6f7-ff5b-4d94-8629-d3050e6b18db.jpg)

(b) UR5-Bowl

(c) UR5-Breakfast

Fig. 2: UR5 tasks used for evaluation: (a) task of picking up the cube, (b) task of bringing the cube to the bowl, (c) task of pouring the cup and the bottle into the bowl. (Left) simulation, (right) real robot.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-da4f2ff1-6cf4-4431-bcd1-c362c8b50c86.jpg)

each trial. The reward of the task is a single sparse reward of success. The maximum length of the task is 50 time-steps.

(a) FetchPickPlace

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-7cccb89d-20eb-40df-92e8-9e18fda3f4af.jpg)

(b) Comparison with [7]

Fig. 3: Comparison of BC ResNet-18 with state of the art [7] on the FetchPickPlace task. BC ResNet-18 results are reported for 200 different initial configurations.

level of individual steps and is hence expected to result in higher compounding errors.

## B. Evaluation of data augmentation

We evaluate the impact of different types of data augmentations in Table II. We compare training without data augmentation with 3 variants: (1) random translations, rotations and crops, as is standard for object detection, (2) record each expert synthetic demonstration from 10 varying viewpoints and (3) the combination of (1) and (2).

Success rates for UR5-Pick on datasets with 20, 50 and 100 demonstrations are reported in Table II. We observe that data augmentation is particularly important when only a few demonstrations are available. For 20 demonstrations, the policy trained with no augmentation performs at 1% while the policy trained with standard and viewpoint augmentations together performs at 75%. The policy trained with a combination of both augmentation types performs the best and achieves 93% and 100% success rate for 50 and 100 demonstrations respectively. In summary, data augmentation allows a significant reduction in the number of expert trajectories required to solve the task.

## C. Real robot experiments

We evaluate our method on the real-world UR5-Pick illustrated in Figure 2a(right). We collect demonstrated trajectories in simulation and train the BC skills network applying standard, viewpoint and sim2real augmentations. We show that our approach transfers well to the real robot using no real images. The learned policy manages to pick up cubes of 3 different sizes correctly in 20 out of 20 trials.

## D. Comparison with state-of-the-art methods

One of the few test-beds for robotic manipulation is FetchPickPlace from OpenAI Gym [13] implemented in mujoco [51], see Figure 3a. The goal for the agent is to pick up a cube and to move it to the red target (see Figure 3a). The agent observes the three last RGB-D images from a camera placed in front of the robot o t ∈ R 100 × 100 × × 4 3 . The positions of the cube and the target are set at random for

For a fair comparison with [7], we do not use any data augmentation. We report the success rate of ResNet-18 policy in Figure 3b. We follow [7] and plot the success rate of both RL and IL methods with respect to the number of episodes used (either trial episodes or demonstrations). Our approach outperforms the policies trained with an imitation learning method DAgger [6] in terms of performance and RL methods such as HER [52] and DDPG [53] in terms of data-efficiency. According to [7], DAgger does not reach 100% even after 8 ∗ 10 4 demonstrations despite the fact that it requires an expert during training. HER reaches the success rate of 100% but requires about 4 ∗ 10 4 trial episodes. Our approach achieves the 96% success rate using 10 4 demonstrations.

Our policies differ from [7] mainly in the CNN architecture. Pinto et al. [7] use a simple CNN with 4 convolutional layers while we use ResNet-18. Results of this section confirm the large impact of the CNN architecture on the performance of visual BC policies, as was already observed in Table I.

## VI. EVALUATION OF RLBC

This section evaluates the proposed RLBC approach and compares it to baselines introduced in Section VI-A. First, we evaluate our method on UR5-Bowl in Section IV-B. We then test the robustness of our approach to various perturbations such as dynamic changes of object positions, dynamic occlusions, unseen object instances and the increased probability of collisions due to small distances between objects. We show that RLBC outperforms the baselines on those scenarios both in simulation and on a real robot. Note, that our real robot experiments are performed with skills and master policies that have been trained exclusively in simulation using sim2real augmentation [14]. We use the same policies for all perturbation scenarios. Qualitative results of our method are available in the supplementary video .

## A. Baseline methods

We compare RLBC with 3 baselines: (a) a fixed sequence of BC skills following the manually pre-defined correct order (BC-ordered); (b) an open-loop controller estimating positions of objects and executing an expert script (Detect &amp; Plan); (c) a closed-loop controller performing the same estimationbased control and replanning in case if object positions change substantially (Detect &amp; Replan). We use the same set of skills for RLBC and BC-ordered. We train the position estimation network using a dataset of 20.000 synthetic depth images with randomized object positions. All networks use ResNet18 architecture and are trained with the standard, viewpoint and sim2real augmentations described in Section V-B.

TABLE III: Comparison of RLBC with 3 baselines on the real-world UR5-Bowl task with dynamic changes of the cube position, dynamic occlusions and new object instances.

| UR5-Bowl perturbations   | Detect & Plan   | Detect & Replan   | BC-ordered   | RLBC   |
|--------------------------|-----------------|-------------------|--------------|--------|
| No perturbations         | 17/20           | 16/20             | 17/20        | 20/20  |
| Moving objects           | 0/20            | 12/20             | 13/20        | 20/20  |
| Occlusions               | 17/20           | 10/20             | 2/20         | 18/20  |
| New objects              | 16/20           | 14/20             | 15/20        | 18/20  |

Fig. 4: Performance of RLBC and baseline methods in simulated environments under perturbations: (a) Dynamic changes of cube position; (b) Dynamic occlusions; (c) Replacing the cube by unseen objects; (d) Decreasing the distance between objects.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-5dbf083a-e721-4ed2-ad6f-1cfeb09919f8.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-6c6fab64-56f8-486e-82d7-14482d9dee44.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-7efdd62e-177f-4808-aeb5-bcc2cf4f90e9.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00722v3-figure-16d34da4-1f9b-4b4b-8dc4-e1e7292189bf.jpg)

## B. Results on UR5-Bowl with no perturbations

We first evaluate RLBC and the three baselines on the UR5-Bowl task (see Figure 2b). When tested in simulation, all the baselines and RLBC manage to perfectly solve the task. On the real-world UR5-Bowl task, BC-ordered and Detect &amp; Plan baselines sometimes fail to grasp the object which leads to task failures (see Table III, first row). On the contrary, RLBC solves the task in all 20 episodes given its ability to re-plan the task in the cases of failed skills.

We have also attempted to solve the simulated UR5-Bowl task without skills by learning an RL policy performing lowlevel control. We have used ImageNet pre-trained ResNet-18 to generate visual features. The features were then used to train low-level RL control policy with PPO. Whereas such a low-level RL policy did not solve the task a single time after 10 4 episodes, RLBC reaches 100% after 400 episodes.

## C. Robustness to perturbations

Robustness to dynamic changes in object position. We evaluate RLBC against the baselines in the UR5-Bowl scenario where the cube is moved several times during the episode. We plot success rates evaluated in simulation with respect to the number of position changes in Figure 4a. We observe the stability of RLBC and the fast degradation of all baselines. As both RLBC and BC-ordered use the same set of skills, the stability of RLBC comes from the learned skill combination. The "Moving objects" row in Table III reports results for 3 moves of the cube evaluated on the real robot. Similar to simulated results, we observe excellent results of RLBC and the degraded performance for all the baselines.

Robustness to occlusions. We evaluate the success of UR5Bowl task under occlusions. Each occlusion lasts 3 seconds and covers a large random part of the workspace by a cardboard. Figure 4b shows success rates with respect to the number of occlusions in the simulated UR5-Bowl environment. Similar to perturbation results in Figure 4a, RLBC demonstrates high robustness to occlusions while the performance of other methods quickly degrades. The "Occlusions" row in Table III reports results for a single occlusion performed during the real-robot evaluation. Baseline methods are strongly influenced by occlusions except Detect &amp; Plan which performs well unless occlusion happens during the first frames. Our HRBC policy performs best compared to other methods.

Robustness to new object instances. We evaluate the robustness of methods to the substitution of a cube by other objects not seen during the training of UR5-Bowl task. Figure 4c shows the success rate of RLBC and other methods with respect to the number of new objects in simulation. The novel objects are ordered by their dissimilarity with the cube. The difficulty of grasping unseen objects degrades the performance of grasping skills. In contrast to other methods RLBC is able to automatically recover from errors by making several grasping attempts. Table III reports corresponding results on a real robot where the cube has been replaced by 10 unseen objects. Similar to other perturbations we observe superior performance of RLBC.

Impact of the distance between objects. We vary the distance between a bottle and a cup in the UR5-Breakfast task. The smaller distance between objects A and B implies higher probability of collision between a robot and A when grasping B behind A. The choice of the grasping order becomes important in such situations. While our method is able to learn the appropriate grasping order to maximize the chance of completing the task, the BC-ordered and other baselines use pre-defined order. Figure 4d demonstrates the performance of RLBC and BC-ordered for different object distances in the simulated UR5-Breakfast task. As expected, RLBC learns the correct grasping order and avoids most of collisions. The performance of BC-ordered strongly degrades with the decreasing distance. In the real-world evaluation, both RLBC and ordered skills succeed in 16 out of 20 episodes when the distance between objects is larger than 10 cm. However, the performance of BC-ordered drops to 8/20 when the cup and the bottle are at 4 cm from each other. In contrast, RLBC chooses the appropriate object to avoid collisions and succeeds in 16 out of 20 trials.

## VII. CONCLUSION

This paper presents a method to learn combinations of primitive skills. Our method requires no full-task demonstrations nor intermediate rewards and shows excellent results in simulation and on a real robot. We demonstrate the versatility of our approach in challenging settings with dynamic scene changes. Future work will include learning multiple tasks with shared skills and addressing contact-rich tasks.

## REFERENCES

- 19: ] [1 F. Suárez-Ruiz, X. Zhou, and Q.-C. Pham, 'Can robots assemble an ikea chair?' Science Robotics , vol. 3, no. 17, p. eaat6385, 2018. 1
- [2] S. Srivastava, E. Fang, L. Riano, R. Chitnis, S. Russell, and P. Abbeel, 'Combined task and motion planning through an extensible plannerindependent interface layer,' in 2014 IEEE international conference on robotics and automation (ICRA) . IEEE, 2014, pp. 639-646. 1
- [3] T. Lozano-Pérez and L. P. Kaelbling, 'A constraint-based method for solving sequential manipulation planning problems,' in 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems . IEEE, 2014, pp. 3684-3691. 1
- [4] M. Toussaint, 'Logic-geometric programming: An optimization-based approach to combined task and motion planning,' in Twenty-Fourth International Joint Conference on Artificial Intelligence , 2015. 1
- [5] D. A. Pomerleau, 'Alvinn: An autonomous land vehicle in a neural network,' in NIPS , 1989. 1, 2
- [6] S. Ross and J. A. Bagnell, 'Reinforcement and imitation learning via interactive no-regret learning,' in arXiv , 2014. [Online]. Available: http://arxiv.org/abs/1406.5979 1, 2, 5
- [7] L. Pinto, M. Andrychowicz, P. Welinder, W. Zaremba, and P. Abbeel, 'Asymmetric Actor Critic for Image-Based Robot Learning,' RSS , 2018. 1, 2, 5
- [8] A. Y. Ng and S. J. Russell, 'Algorithms for inverse reinforcement learning,' in ICML , 2000. 1, 2
- [9] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis, 'Human-level control through deep reinforcement learning,' Nature , 2015. [Online]. Available: http://www.nature.com/doifinder/10.1038/nature14236 1, 2
- [10] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis, 'Mastering the game of Go with deep neural networks and tree search,' Nature , 2016. 1, 2
- [11] A. Das, G. Gkioxari, S. Lee, D. Parikh, and D. Batra, 'Neural modular control for embodied question answering,' in CoRL , 2018. 1, 2
- [12] H. M. Le, N. Jiang, A. Agarwal, M. Dudík, Y. Yue, and H. D. III, 'Hierarchical imitation and reinforcement learning,' in ICML , 2018. 1, 2
- [13] M. Plappert, M. Andrychowicz, A. Ray, B. McGrew, B. Baker, G. Powell, J. Schneider, J. Tobin, M. Chociej, P. Welinder, V. Kumar, and W. Zaremba, 'Multi-goal reinforcement learning: Challenging robotics environments and request for research,' arXiv , 2018. [Online]. Available: http://arxiv.org/abs/1802.09464 1, 5
- [14] A. Pashevich, R. Strudel, I. Kalevatykh, I. Laptev, and C. Schmid, 'Learning to augment synthetic images for sim2real policy transfer,' IROS , 2019. 1, 3, 5
- [15] T. Lampe and M. Riedmiller, 'Acquiring visual servoing reaching and grasping skills using neural reinforcement learning,' IJCNN , 2013. 2
- [16] S. Gu, E. Holly, T. Lillicrap, and S. Levine, 'Deep reinforcement learning for robotic manipulation,' in ICML , 2016. [Online]. Available: http://arxiv.org/abs/1610.00633 2
- [17] S. Levine, C. Finn, T. Darrell, and P. Abbeel, 'End-to-end training of deep visuomotor policies,' JMLR , 2015. [Online]. Available: http://arxiv.org/abs/1504.00702 2
- [18] I. Popov, N. Heess, T. Lillicrap, R. Hafner, G. Barth-Maron, M. Vecerik, T. Lampe, Y. Tassa, T. Erez, and M. Riedmiller, 'Data-efficient Deep Reinforcement Learning for Dexterous Manipulation,' arXiv , 2017. [Online]. Available: http://arxiv.org/abs/1704.03073 2
- [19] Y. Duan, M. Andrychowicz, B. C. Stadie, J. Ho, J. Schneider, I. Sutskever, P. Abbeel, and W. Zaremba, 'One-shot imitation learning,' NIPS , 2017. 2
- [20] M. A. Riedmiller, R. Hafner, T. Lampe, M. Neunert, J. Degrave, T. V. de Wiele, V. Mnih, N. Heess, and J. T. Springenberg, 'Learning by playing - Solving sparse reward tasks from scratch,' MLR , 2018. [Online]. Available: http://arxiv.org/abs/1802.10567 2
- [21] J. Ho and S. Ermon, 'Generative adversarial imitation learning,' in NIPS , 2016. 2
- [22] V. Kumar, A. Gupta, E. Todorov, and S. Levine, 'Learning dexterous manipulation policies from experience and imitation,' arXiv , 2016. [Online]. Available: http://arxiv.org/abs/1611.05095 2
- [23] M. Laskey, J. Lee, R. Fox, A. D. Dragan, and K. Goldberg, 'DART: Noise injection for robust imitation learning,' in CoRL , 2017. [Online]. Available: http://proceedings.mlr.press/v78/laskey17a.html 2
- [24] J. Kober, J. A. Bagnell, and J. Peters, 'Reinforcement learning in robotics: A survey,' IJRR , vol. 32, no. 11, 2013. 2
- [25] R. S. Sutton, D. Precup, and S. Singh, 'Between mdps and semimdps: A framework for temporal abstraction in reinforcement learning,' Artificial intelligence , vol. 112, no. 1-2, pp. 181-211, 1999. 2
- [26] P. Dayan and G. Hinton, 'Feudal Reinforcement Learning,' in NIPS , 1993. 2
- [27] K. Frans, J. Ho, X. Chen, P. Abbeel, and J. Schulman, 'Meta learning shared hierarchies,' ICLR , 2018. [Online]. Available: http://arxiv.org/abs/1710.09767 2
- [28] Y. Lee, S.-H. Sun, S. Somasundaram, E. S. Hu, and J. J. Lim, 'Composing complex skills by learning transition policies with proximity reward induction,' in ICLR , 2019. 2
- [29] P.-L. Bacon, J. Harb, and D. Precup, 'The option-critic architecture.' in AAAI , 2017. 2
- [30] C. Florensa, Y. Duan, and P. Abbeel, 'Stochastic neural networks for hierarchical reinforcement learning,' ICLR , 2017. [Online]. Available: http://arxiv.org/abs/1704.03012 2
- [31] T. Haarnoja, K. Hartikainen, P. Abbeel, and S. Levine, 'Latent space policies for hierarchical reinforcement learning,' ICML , 2018. [Online]. Available: http://arxiv.org/abs/1804.02808 2
- [32] O. Nachum, S. Gu, H. Lee, and S. Levine, 'Data-efficient hierarchical reinforcement learning,' NIPS , 2018. [Online]. Available: http://arxiv.org/abs/1805.08296 2
- [33] A. S. Vezhnevets, S. Osindero, T. Schaul, N. Heess, M. Jaderberg, D. Silver, and K. Kavukcuoglu, 'Feudal networks for hierarchical reinforcement learning,' in ICML , 2017. [Online]. Available: http://arxiv.org/abs/1703.01161 2
- [34] T. D. Kulkarni, K. Narasimhan, A. Saeedi, and J. Tenenbaum, 'Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation,' in NIPS , 2016. 2
- [35] K. Hausman, J. T. Springenberg, Z. Wang, N. Heess, and M. Riedmiller, 'Learning an embedding space for transferable robot skills,' in ICLR , 2018. [Online]. Available: https://openreview.net/forum?id=rk07ZXZRb 2
- [36] Y. Gao, H. Xu, J. Lin, F. Yu, S. Levine, and T. Darrell, 'Reinforcement learning from imperfect demonstrations,' ICLR workshop , 2018. [Online]. Available: https://openreview.net/forum?id=BJJ9bz-02
- [37] C.-A. Cheng, X. Yan, N. Wagener, and B. Boots, 'Fast policy learning through imitation and reinforcement,' UAI , 2018. 2
- [38] W. Sun, J. A. Bagnell, and B. Boots, 'Truncated horizon policy search: Combining reinforcement learning &amp; imitation learning,' in ICLR , 2018. 2
- [39] T. Hester, M. Vecerik, O. Pietquin, M. Lanctot, T. Schaul, B. Piot, A. Sendonaris, G. Dulac-Arnold, I. Osband, J. Agapiou, J. Z. Leibo, and A. Gruslys, 'Deep Q-Learning from demonstrations,' AAAI , 2018. 2
- [40] A. Nair, B. McGrew, M. Andrychowicz, W. Zaremba, and P. Abbeel, 'Overcoming exploration in reinforcement learning with demonstrations,' in ICRA , 2018. [Online]. Available: https: //doi.org/10.1109/ICRA.2018.8463162 2
- [41] Y. Zhu, Z. Wang, J. Merel, A. A. Rusu, T. Erez, S. Cabi, S. Tunyasuvunakool, J. Kramár, R. Hadsell, N. de Freitas, and N. Heess, 'Reinforcement and imitation learning for diverse visuomotor skills,' arXiv , 2018. [Online]. Available: http://arxiv.org/abs/1802.09564 2
- [42] E. Perez, F. Strub, H. de Vries, V. Dumoulin, and A. C. Courville, 'Film: Visual reasoning with a general conditioning layer,' in AAAI , 2018. 2
- [43] D. P. Kingma and J. Ba, 'Adam: A method for stochastic optimization,' ICLR , 2015. 3
- [44] S. Ioffe and C. Szegedy, 'Batch normalization: Accelerating deep network training by reducing internal covariate shift,' in ICML , 2015. [Online]. Available: http://arxiv.org/abs/1502.03167 3
- [45] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, 'Proximal policy optimization algorithms,' arXiv , 2017. [Online]. Available: http://arxiv.org/abs/1707.06347 3
- [46] I. Kostrikov, 'Pytorch implementations of reinforcement learning algorithms,' https://github.com/ikostrikov/pytorch-a2c-ppo-acktr, 2018. 3
- [47] E. Courmans and Y. Bai, 'PyBullet, Python module for physics simulation, robotics and machine learning,' http://pybullet.org/, 20162017. 4
- [48] A. X. Chang, T. Funkhouser, L. Guibas, P. Hanrahan, Q. Huang, Z. Li, S. Savarese, M. Savva, S. Song, H. Su, J. Xiao, L. Yi, and F. Yu, 'ShapeNet: An information-rich 3D model repository,' arXiv , 2015. [Online]. Available: http://arxiv.org/abs/1512.03012 4
- [49] K. Simonyan and A. Zisserman, 'Very deep convolutional networks for large-scale image recognition,' arXiv , 2014. [Online]. Available: http://arxiv.org/abs/1409.1556 4
- [50] K. He, X. Zhang, S. Ren, and J. Sun, 'Deep Residual Learning for Image Recognition,' CVPR , 2016. 4
- [51] E. Todorov, T. Erez, and Y. Tassa, 'MuJoCo: A physics engine for model-based control,' in IROS , 2012. [Online]. Available: http://ieeexplore.ieee.org/document/6386109/ 5
- [52] M. Andrychowicz, F. Wolski, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba, 'Hindsight experience replay,' in NIPS , 2017. 5
- [53] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, 'Continuous control with deep reinforcement learning,' ICLR , 2016. [Online]. Available: http://arxiv.org/abs/1509.02971 5
Robin Strudel Alexander Pashevich Igor Kalevatykh Ivan Laptev Josef Sivic Cordelia Schmid
Learning to combine primitive skills: A step towards versatile robotic manipulation
Manipulation tasks such as preparing a meal or assembling furniture remain
highly challenging for robotics and vision. Traditional task and motion
planning (TAMP) methods can solve complex tasks but require full state
observability and are not adapted to dynamic scene changes. Recent learning
methods can operate directly on visual inputs but typically require many
demonstrations and/or task-specific reward engineering. In this work we aim to
overcome previous limitations and propose a reinforcement learning (RL)
approach to task planning that learns to combine primitive skills. First,
compared to previous learning methods, our approach requires neither
intermediate rewards nor complete task demonstrations during training. Second,
we demonstrate the versatility of our vision-based task planning in challenging
settings with temporary occlusions and dynamic scene changes. Third, we propose
an efficient training of basic skills from few synthetic demonstrations by
exploring recent CNN architectures and data augmentation. Notably, while all of
our policies are learned on visual inputs in simulated environments, we
demonstrate the successful transfer and high success rates when applying such
policies to manipulation tasks on a real UR5 robotic arm.