Training Neural Network Controllers Using Control Barrier Functions in the Presence of Disturbances

Shakiba Yaghoubi, Georgios Fainekos, Sriram SankaranarayananarXiv 2020

TL;DR

Enforcing safety in autonomous systems often requires solving complex optimization problems (Quadratic Programs) in real time, which is too computationally expensive for low-power embedded hardware. This paper extends High-Order Control Barrier Functions to handle external disturbances and uses imitation learning (the DAGGER algorithm) to train a fast, lightweight Neural Network controller that mimics the safe but slow optimization expert.

What Problem Does This Paper Address?

In safety-critical control—such as keeping an autonomous vehicle from crashing or a drone from drifting off course—Control Barrier Functions (CBFs) act as mathematical guardrails. Typically, these guardrails are enforced by solving a Quadratic Program (QP) online at every single timestep to calculate the safest control input.

However, this approach has two major drawbacks:

  1. Computational Overhead: Solving QPs in real time requires significant processing power, making it impractical for resource-constrained embedded systems that demand hard real-time execution.
  2. Vulnerability to Disturbances: Real-world systems constantly face external disturbances like wind gusts or water currents. Standard high-order CBFs do not inherently account for these uncertainties, risking safety violations.

The authors tackle this dual challenge by developing a robust control framework that is both computationally efficient and resilient to external disturbances.

Methods

The paper introduces a two-step solution combining control theory and machine learning:

  1. High-Order Control Barrier Functions in the Presence of Disturbance (HOCBFD): The authors mathematically extend high-order CBFs to systems with affine controls subject to external disturbances. For systems where the control input doesn't appear in the first derivative of the safety function (high relative degree), they formulate an optimization problem to find the worst-case disturbance. By using linear class $\mathcal{K}$ functions, this worst-case calculation simplifies into a manageable QP.
  2. Imitation Learning via DAGGER: To bypass the need to solve this heavy QP online, the authors use it as an offline "expert" to train a shallow Neural Network (NN) controller. To prevent compounding errors—where small mistakes by the NN lead it into unfamiliar states where it fails entirely—they use the DAGGER (Dataset Aggregation) algorithm. DAGGER iteratively runs the NN controller, collects the visited states, queries the QP expert for the ideal safe action at those states, aggregates the data, and retrains the NN.

Datasets

No standard real-world datasets were used in this work. Instead, the authors evaluated their approach using a simulated environment of a surface water vehicle (a unicycle model) navigating a reach-avoid task. The training data was generated synthetically on-the-fly through the interactive DAGGER training loop.

Key Insights and Ideas

  • Implicit Robustness: Because the NN controller learns directly from a QP expert that calculates actions based on worst-case disturbances, the NN implicitly inherits this robustness. It learns to counteract random disturbances at runtime without ever needing to explicitly solve a worst-case optimization problem itself.
  • Smart Data Preprocessing: Instead of feeding the raw heading angle ($\theta$) directly into the neural network, the authors transform it into $\sin(\theta)$ and $\cos(\theta)$. This eliminates the mathematical discontinuity that occurs when wrapping angles between $-\pi$ and $\pi$, making it significantly easier for the shallow network to learn smooth control laws.

Key Results

  • Fast Convergence: The shallow NN successfully learned to imitate the complex QP expert after just 11 iterations of the DAGGER loop.
  • Robust Performance: In simulations, the trained NN successfully steered the water vehicle to its goal while safely dodging five distinct obstacle zones, even when subjected to randomized external disturbances.

The trajectories generated by the expert QP (under zero noise) and the trained NN controller (under random disturbances) demonstrate how the network successfully replicates the safe behavior of the optimization framework:

Trajectories under QP expert vs trained NN controller

Limitations and Future Work

  • Lack of Formal Safety Guarantees: Although the original QP controller is mathematically provable as safe, the neural network is an approximation. The authors do not yet provide formal safety guarantees for the NN controller under all possible initial conditions.
  • Future Directions: To address this, the authors plan to use formal verification tools (such as Sherlock) to establish provable safety bounds for the learned network. They also intend to explore adversarial counter-example generation methods to find edge cases and speed up the offline training process.

Summary updated

BibTeX
@misc{yaghoubi2020training,
  author = {Shakiba Yaghoubi and Georgios Fainekos and Sriram Sankaranarayanan},
  title = {{Training Neural Network Controllers Using Control Barrier Functions in the Presence of Disturbances}},
  year = {2020},
  eprint = {2001.08088},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2001.08088},
}

Loading related content...

Figure