SAFARI: Safe and Active Robot Imitation Learning with Imagination

Norman Di Palo, Edward JohnsarXiv 2020 · arXiv

Abstract

Imitation Learning (IL) often fails due to distribution shift, where small errors lead robots into unfamiliar states. We present SAFARI, a framework that leverages a robot's "imagination"—a learned dynamics model—to proactively manage safety and data efficiency. SAFARI uses its predictive capabilities to actively request human demonstrations during training and to steer itself toward familiar, safe states during deployment. Our results demonstrate significant improvements in success rates and safety across complex manipulation tasks in both simulation and the real world.

Introduction

Teaching robots through Behavioral Cloning (BC) is a popular approach in Imitation Learning. However, BC suffers from the "compounding error" problem: a single mistake can push the robot into an out-of-distribution (OOD) state. Without knowledge of how to recover, the robot's behavior becomes erratic, often leading to failure. Existing mitigation strategies, such as autonomous exploration, can be unsafe, while constant human monitoring is impractical. SAFARI addresses this by enabling the robot to recognize its own uncertainty and act to stay within the "safe zone" of its training data.

Methodology

The SAFARI framework integrates three neural components: a Policy Network for action generation, a Dynamics Network (world model) for state prediction, and an Uncertainty Network for safety monitoring.

The SAFARI framework integrates active learning during training and uncertainty-aware control during deployment.

Active Learning and Imagination

During training, the robot does not merely observe. It uses its dynamics model to "unroll" potential future trajectories in imagination. If the Uncertainty Network (implemented as a Denoising Autoencoder) predicts that a future state will be OOD, the robot stops and queries a human expert for a demonstration. This active approach ensures that the training dataset specifically covers the robot's areas of highest uncertainty, maximizing information gain per demonstration.

Safe Deployment via State Shift Minimization

In the deployment phase, SAFARI employs a hybrid control strategy. Rather than following the policy blindly, the robot uses an online planner to minimize future uncertainty.

Action selection mechanism: the final action is a combination of the policy's suggestion and a corrective vector that steers the robot toward low-uncertainty states.

As shown in the figure above, the process involves:

  1. Sampling potential actions and predicting future states and their associated uncertainty.
  2. Selecting the action that would bring the robot into the state with the lowest predicted uncertainty.
  3. Combining the policy action with this corrective "imagined plan" to produce the final total action.

Additionally, SAFARI provides rapid failure prediction. By unrolling the policy in imagination, the robot can detect if it is on a trajectory toward failure before it occurs. If predicted uncertainty exceeds a safety threshold, the robot autonomously halts execution to prevent damage.

Experimental Evaluation

SAFARI was benchmarked on several challenging manipulation tasks:

  • Simulation (MuJoCo): Fetch robot tasks (1-cube pick-and-place, 2-cube stacking) and Sawyer robot nut-and-peg insertion.
  • Real-World: A Sawyer robot vision-based task requiring the sliding of an object to a goal position using raw RGB camera input and end-effector poses.

Key Results and Insights

  • Performance and Efficiency: In the Fetch 1-cube task, SAFARI outperformed passive learning in 88% of trials. It achieved higher success rates with fewer demonstrations compared to baselines like DART.
  • Safety and Robustness: The imagination-based safety buffer allowed the robot to predict and prevent failures more effectively than monitoring current state uncertainty alone.
  • Real-World Scalability: The system successfully generalized to real-world tasks, with performance improving as the ratio of active demonstrations increased.

Conclusion

SAFARI demonstrates that "imagination" is a powerful tool for both data-efficient training and safe deployment in robotics. By combining model-free behavior with model-based safety planning, the framework provides a robust solution to the distribution shift problem. Future work will focus on handling aleatoric uncertainty and reducing the dependency on the accuracy of the learned dynamics model.

Summary updated

Abstract

One of the main issues in Imitation Learning is the erroneous behavior of an agent when facing out-of-distribution situations, not covered by the set of demonstrations given by the expert. In this work, we tackle this problem by introducing a novel active learning and control algorithm, SAFARI. During training, it allows an agent to request further human demonstrations when these out-of-distribution situations are met. At deployment, it combines model-free acting using behavioural cloning with model-based planning to reduce state-distribution shift, using future state reconstruction as a test for state familiarity. We empirically demonstrate how this method increases the performance on a set of manipulation tasks with respect to passive Imitation Learning, by gathering more informative demonstrations and by minimizing state-distribution shift at test time. We also show how this method enables the agent to autonomously predict failure rapidly and safely.
BibTeX
@misc{palo2020safari,
  author = {Norman Di Palo and Edward Johns},
  title = {{SAFARI: Safe and Active Robot Imitation Learning with Imagination}},
  year = {2020},
  eprint = {2011.09586},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.09586},
}
Figure