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.
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.
As shown in the figure above, the process involves:
- Sampling potential actions and predicting future states and their associated uncertainty.
- Selecting the action that would bring the robot into the state with the lowest predicted uncertainty.
- 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