Safe Reinforcement Learning Using Black-Box Reachability Analysis

Mahmoud Selim, Amr Alanwar, Shreyas Kousik, Grace Xingxin Gao, Marco Pavone, Karl Henrik JohanssonIROS 2022 · DOI

TL;DR

This paper introduces the Black-Box Reachability-based Safety Layer (BRSL), a novel framework that enables safe reinforcement learning (RL) for robots with unknown dynamics. BRSL combines data-driven reachability analysis with differentiable collision checking to guarantee safety without sacrificing performance, outperforming existing methods in various simulated robotic tasks.

What Problem Does This Paper Address?

Reinforcement learning (RL) has shown immense promise in enabling robots to learn complex behaviors, from motion planning to control. However, a major hurdle to their widespread deployment in safety-critical applications (like autonomous driving or drone delivery) is the lack of robust safety guarantees. Current deep RL methods often struggle with unknown or uncertain robot and environment dynamics, making it difficult to ensure that a robot will not collide with obstacles or enter dangerous states, especially during the learning process. This paper tackles this challenge by proposing a method that can provide strict safety guarantees even when the robot's internal workings are treated as a "black box."

Methods

The core of the proposed solution is the Black-Box Reachability-based Safety Layer (BRSL), which acts as a safety net around a standard RL agent. BRSL has three key components:

  1. Data-Driven Reachability Analysis: Instead of relying on an explicit model of the robot's dynamics, BRSL uses data collected from the robot (or a simulator) to predict the set of all possible future states the robot could reach given a planned sequence of actions. This is achieved using a technique called zonotope-based reachability analysis, which overapproximates the robot's "reachable set" (the set of all possible future states). This analysis is performed on a learned, online model of the environment.
  2. Trajectory Rollout Planner: An RL agent, trained using an ensemble of neural networks, generates candidate action sequences (plans). This planner predicts future actions and observations based on the learned environment model.
  3. Differentiable Polytope Collision Check and Adjustment: This is a crucial innovation. BRSL uses a differentiable method to check if the predicted reachable set intersects with known obstacles. If a collision is detected, BRSL employs a gradient-descent-based approach to adjust the planned actions. This adjustment aims to "push" the reachable set away from obstacles while ensuring the plan still includes a "failsafe maneuver" (like braking to a stop). This process is iterated until a safe plan is found or a failsafe is triggered.

Datasets

The paper does not explicitly mention specific public datasets. Instead, it describes collecting noisy trajectory data offline from the robot or its simulator. This data is used for two purposes:

  • Training the environment model (an ensemble of neural networks).
  • Performing the data-driven reachability analysis.

The authors note that the quantity and representativeness of this data are crucial for ensuring safety and that future work could explore optimal data collection strategies.

Key Insights and Ideas

  • Safety without a Model: The most significant insight is the ability to guarantee safety even when the robot's internal dynamics are unknown (treated as a black box). This is achieved by leveraging data-driven reachability analysis, which is inherently model-agnostic.
  • Differentiable Safety: Making the collision checking and adjustment process differentiable is key. This allows for efficient gradient-based optimization to correct unsafe plans, rather than relying on more computationally expensive sampling-based methods.
  • Online Learning for Dynamics, Offline for Safety: BRSL separates the learning of the environment dynamics (done online) from the safety guarantee (provided by offline-computed reachability). This separation is critical because the safety layer's guarantees hold even if the learned dynamics model is imperfect, as long as the offline data is representative.
  • Failsafe as a Guarantee: The inclusion of a failsafe maneuver (like braking) as a mandatory part of any safe plan is a practical and effective way to ensure safety even if the adjustment process fails to find a collision-free trajectory.

Key Results

BRSL was evaluated on four simulated robotic tasks:

  • Goal-based navigation: Turtlebot3 and a quadrotor navigating to a goal while avoiding obstacles.
  • Path following: A point mass and a hexarotor following a specific trajectory.

In these experiments, BRSL consistently outperformed other state-of-the-art safe RL methods (RTS, SAILR, SECAS) and a baseline RL agent (TD3) in terms of:

  • Safety: BRSL achieved a 0% collision rate in most goal-based scenarios, significantly outperforming methods that had higher collision rates.
  • Reward: BRSL generally achieved higher average rewards, indicating a better balance between task completion and safety.
  • Conservativeness: While BRSL is designed to be safe, the paper suggests it is not overly conservative, achieving competitive speeds and rewards.

For example, in the Turtlebot and Quadrotor goal-based experiments, BRSL achieved a 0% collision rate while maintaining competitive goal rates and speeds compared to other safe RL methods.

Limitations and Future Work

The authors acknowledge several limitations:

  • Discrete-Time Assumption: The current framework operates in discrete time. Extending it to continuous-time systems is a direction for future work.
  • Perception Uncertainty: The current method assumes perfect perception of the robot's surroundings. Handling noisy or uncertain sensor data is left for future research.
  • Data Requirements: The accuracy of the reachability analysis depends on the quality and quantity of offline data. While they found 500 time steps sufficient empirically, a formal analysis of data requirements is needed.
  • Lipschitz Constant Approximation: The method requires approximating the Lipschitz constant of the system dynamics, which can lead to a "curse of dimensionality" with respect to the number of samples needed.
  • Dynamic Environments: The current work assumes static obstacles. Extending BRSL to handle dynamic environments (e.g., other moving agents) is a promising avenue.

Future work will focus on addressing these limitations, including exploring continuous-time settings, reducing the conservativeness of the reachability analysis, and minimizing the amount of data needed for safety guarantees.

Summary updated

BibTeX
@inproceedings{selim2022safe,
  author = {Mahmoud Selim and Amr Alanwar and Shreyas Kousik and Grace Xingxin Gao and Marco Pavone and Karl Henrik Johansson},
  title = {{Safe Reinforcement Learning Using Black-Box Reachability Analysis}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2022},
  doi = {10.1109/lra.2022.3192205},
}
Figure