Safe Predictors for Enforcing Input-Output Specifications

Stephen Mell, Olivia M. Brown, Justin A. Goodwin, Sung-Hyun SonarXiv 2020

Abstract

We present an approach for designing correct-by-construction neural networks (and other machine learning models) that are guaranteed to be consistent with a collection of input-output specifications before, during, and after algorithm training. Our method involves designing a constrained predictor for each set of compatible constraints, and combining them safely via a convex combination of their predictions. We demonstrate our approach on synthetic datasets and an aircraft collision avoidance problem.

Introduction

As machine learning models are increasingly deployed in safety-critical systems, such as autonomous vehicles and aircraft collision avoidance, the "black box" nature of standard neural networks poses significant risks. Traditional models often violate fundamental logical or physical constraints, especially in edge cases not well-represented in training data.

Current safety assurance typically relies on post-hoc verification, where a model is first trained and then checked against specifications using formal methods like SMT solvers. If violations are found, the model must be retrained or patched—a process that is both computationally expensive and lacks guarantees during the training phase itself. This research introduces a "correct-by-construction" framework that embeds safety directly into the network architecture, ensuring that outputs remain within predefined safe bounds at all times.

Methodology: The Safe Predictor Framework

The core of the proposed approach is the Safe Predictor, which partitions the input space based on applicable safety constraints and blends specialized "constrained predictors" to produce a final, guaranteed-safe output.

The framework operates through several key components:

  1. Input-Output Specifications: Users define regions in the input space ($A_i$) and corresponding convex regions in the output space ($B_i$). The safety requirement is that if an input $x \in A_i$, then the output $F(x)$ must lie within $B_i$.
  2. Constrained Predictors ($G_b$): For every combination of overlapping constraints, a specific predictor is defined. These predictors are architecturally constrained (e.g., via a final projection layer) to only produce outputs within the intersection of the allowed safe sets.
  3. Proximity Functions: Differentiable functions calculate the distance of an input to various constrained regions, allowing for smooth transitions.
  4. Safe Blending: The final output $F(x)$ is constructed as a convex combination of the constrained predictors. Because the output regions are convex, any weighted average of safe outputs is mathematically guaranteed to be safe.
The Safe Predictor framework maps inputs to safe output regions using a convex combination of specialized predictors.

This architecture is fully differentiable, meaning it can be trained using standard gradient descent while maintaining safety guarantees throughout the entire learning process.

Experimental Results

The researchers evaluated the Safe Predictor framework on synthetic regression tasks and a high-stakes aircraft collision avoidance problem (VerticalCAS).

Synthetic Visualization

On 1D regression tasks, the Safe Predictor demonstrates its ability to follow training data while strictly avoiding "unsafe" regions. Unlike standard models that might stray into prohibited output zones, the Safe Predictor smoothly transitions between unconstrained and constrained behavior.

Comparison of a standard unconstrained model versus the Safe Predictor. The Safe Predictor (bottom) successfully avoids the prohibited region while maintaining high fidelity to the training data.

Aircraft Collision Avoidance (VerticalCAS)

The framework was applied to the VerticalCAS dataset, derived from the Next-Generation Aircraft Collision Avoidance System (ACAS X). The task involves recommending climb or descent rates to prevent mid-air collisions.

  • Safety Violations: The standard neural network violated safety specifications in approximately 0.20% to 0.22% of test cases. In contrast, the Safe Predictor achieved 0.00% violations.
  • Performance: Enforcing safety did not degrade accuracy. In the "Clear of Conflict" scenario, the Safe Predictor maintained 96.69% accuracy (vs. 96.87% for the standard model). In the "Climb at 1500 ft/min" scenario, it actually outperformed the standard model (94.78% vs. 93.89%).

Discussion and Future Work

By shifting safety from a post-training verification step to an architectural requirement, this framework eliminates the risk of unsafe behavior during online learning or updates. The reliance on convexity is a critical design choice that enables efficient blending of safe outputs.

However, some challenges remain. The number of required predictors can grow with the number of overlapping constraints, though practical applications often have sparse overlaps. Additionally, the current requirement for convex output regions may need to be relaxed or approximated for more complex real-world constraints. Future research will also explore integrating Lipschitz-bounding techniques to enhance robustness against adversarial perturbations.

Summary updated

BibTeX
@misc{mell2020safe,
  author = {Stephen Mell and Olivia M. Brown and Justin A. Goodwin and Sung-Hyun Son},
  title = {{Safe Predictors for Enforcing Input-Output Specifications}},
  year = {2020},
  eprint = {2001.11062},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2001.11062},
}
Figure