Certifiably-correct Control Policies for Safe Learning and Adaptation in Assistive Robotics

Keyvan Majd, Geoffrey Clark, Tanmay Khandait, Siyu Zhou, Sriram Sankaranarayanan, Georgios Fainekos, Heni Ben AmorarXiv 2023

TL;DR

This paper introduces NNRepLayer, a novel framework that uses Mixed Integer Quadratic Programming (MIQP) to "repair" neural network policies, ensuring they adhere to formal safety constraints without significantly degrading performance. This is crucial for safety-critical applications like assistive robotics, where learned policies can exhibit dangerous behaviors in unseen situations.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are increasingly used in robotics for their ability to learn complex dynamics and adapt to users. However, a major hurdle for their adoption in assistive robotics (like prosthetic limbs) is the risk of generating unsafe behaviors. Trained policies might violate critical safety constraints (e.g., joint limits, maximum movement speeds) when encountering novel inputs or scenarios not seen during training. Existing methods like retraining or fine-tuning struggle because they lack known "correct" data for constraint satisfaction and rely on gradient descent, which doesn't guarantee constraint adherence. This paper tackles the problem of making learned robotic control policies provably safe by modifying them to satisfy formal safety specifications.

Methods

The core of the proposed solution is the NNRepLayer framework. It works by formulating the repair problem as a Mixed Integer Quadratic Programming (MIQP) problem. Here's a breakdown:

  • Layer-wise Repair: Instead of retraining the entire network, NNRepLayer focuses on modifying the weights and biases of a single layer at a time. This makes the optimization problem more tractable.
  • MIQP Formulation: The framework explicitly incorporates safety constraints (expressed as predicates) into the optimization objective. It aims to minimize the original loss function (to preserve learned behavior) while simultaneously satisfying these safety constraints.
  • Formal Guarantees: By solving the MIQP, the repaired network is certifiably safe for the specific input samples used in the repair process.
  • Verifier Integration (Algorithm 1): To extend safety guarantees beyond the repair set, the authors propose integrating NNRepLayer with a sound verifier. This iterative process uses the verifier to find adversarial samples that violate constraints, which are then fed back to NNRepLayer for further repair, eventually aiming for a network that is safe across a broader input space.
  • Interval Arithmetic: For handling ReLU activation functions within the MIQP, the paper utilizes Interval Arithmetic to derive tight bounds for node activations, which is essential for formulating the constraints correctly.

Datasets

The paper uses data collected from a healthy subject walking without a prosthesis. This data was captured using inertial measurement units (IMUs) on the upper leg, lower leg, and foot. The IMU data was processed to derive ankle angles and angular velocities. This data was then used to train a neural network policy for controlling a prosthetic ankle. For the repair process, a subset of this data (150 samples) was used for NNRepLayer, with a larger held-out set (2000 samples) for testing.

Key Insights and Ideas

  • Repairing is Different from Verification: The paper clearly distinguishes between verification (checking if a network is safe) and repair (modifying a network to make it safe). NNRepLayer focuses on the latter.
  • MIQP for Certifiable Safety: Using MIQP is a powerful approach because it allows for the explicit inclusion of complex safety constraints and provides formal guarantees of satisfaction for the repaired network on the training data.
  • Layer-wise Repair is Sufficient and Efficient: The authors demonstrate that repairing a single layer can be effective, significantly reducing the computational burden compared to full network retraining or fine-tuning.
  • Iterative Repair with Verification is Key for Generalization: While NNRepLayer guarantees safety on the repair set, combining it with a verifier is crucial for extending these guarantees to unseen inputs, addressing the critical issue of generalization.
  • Safety Constraints Can Be Complex: The paper shows the framework can handle various types of constraints, including global bounds on joint angles and conditional "if-then-else" constraints based on specific body configurations.

Key Results

  • Successful Constraint Satisfaction: NNRepLayer successfully repaired policies to satisfy global constraints (e.g., ankle angle within [-14, 24] degrees) and input-output constraints (e.g., bounding ankle angle rate).
  • Preservation of Performance: The repaired policies maintained performance close to the original trained policies, with minimal increase in Mean Absolute Error (MAE). For example, for input-output constraints, MAE was around 0.5 ± 0.03.
  • High Repair Efficacy: NNRepLayer achieved a repair efficacy (RE) of 98-99% for global and input-output constraints, meaning it successfully fixed almost all adversarial samples.
  • Scalability: The framework was tested on networks with up to 256 neurons per hidden layer, achieving 100% repair efficacy within a reasonable time (10 hours).
  • Comparison to Baselines: NNRepLayer outperformed methods like REASSURE [6] in handling conditional constraints and introduced fewer "bugs" (IB - Introduced Bugs) compared to fine-tuning and retraining.

Limitations and Future Work

  • Adversarial Sample Generation: The paper acknowledges that while their approach guarantees safety for the repaired samples, satisfaction for unseen adversarial samples is not theoretically guaranteed without the iterative verifier loop.
  • Computational Cost: While layer-wise repair is more efficient than full retraining, MIQP solving can still be computationally intensive, especially for larger networks. The paper explores heuristics like partial node repair to speed this up.
  • Future Work: The authors suggest exploring techniques like neural network pruning to identify and repair only the necessary layers and nodes, further reducing computational cost. They also aim to investigate more complex constraint types and real-world deployment challenges.

Summary updated

BibTeX
@misc{majd2023certifiably,
  author = {Keyvan Majd and Geoffrey Clark and Tanmay Khandait and Siyu Zhou and Sriram Sankaranarayanan and Georgios Fainekos and Heni Ben Amor},
  title = {{Certifiably-correct Control Policies for Safe Learning and Adaptation in Assistive Robotics}},
  year = {2023},
  eprint = {2303.06582},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.06582},
}
Figure