Skip to main content
QUICK REVIEW

[Paper Review] Automated Repair of Neural Networks

Dor Cohen, Ofer Strichman|arXiv (Cornell University)|Jul 17, 2022
Adversarial Robustness in Machine LearningComputer Science6 citations
TL;DR

This paper proposes an SMT-based framework to automatically repair unsafe neural networks by modifying only a few weights to satisfy formal safety specifications, achieving adversarial robustness with minimal accuracy loss. The method formulates the repair problem as a logical constraint satisfaction task, enabling provably correct, similar-to-original network behavior.

ABSTRACT

Over the last decade, Neural Networks (NNs) have been widely used in numerous applications including safety-critical ones such as autonomous systems. Despite their emerging adoption, it is well known that NNs are susceptible to Adversarial Attacks. Hence, it is highly important to provide guarantees that such systems work correctly. To remedy these issues we introduce a framework for repairing unsafe NNs w.r.t. safety specification, that is by utilizing satisfiability modulo theories (SMT) solvers. Our method is able to search for a new, safe NN representation, by modifying only a few of its weight values. In addition, our technique attempts to maximize the similarity to original network with regard to its decision boundaries. We perform extensive experiments which demonstrate the capability of our proposed framework to yield safe NNs w.r.t. the Adversarial Robustness property, with only a mild loss of accuracy (in terms of similarity). Moreover, we compare our method with a naive baseline to empirically prove its effectiveness. To conclude, we provide an algorithm to automatically repair NNs given safety properties, and suggest a few heuristics to improve its computational performance. Currently, by following this approach we are capable of producing small-sized (i.e., with up to few hundreds of parameters) correct NNs, composed of the piecewise linear ReLU activation function. Nevertheless, our framework is general in the sense that it can synthesize NNs w.r.t. any decidable fragment of first-order logic specification.

Motivation & Objective

  • To address the critical challenge of ensuring safety in neural networks used in safety-critical applications such as autonomous systems.
  • To provide a formal, provable method for repairing neural networks that fail to meet safety specifications, particularly adversarial robustness.
  • To minimize the number of weight modifications while preserving the original network's decision boundaries and accuracy.
  • To develop a general framework applicable to any decidable first-order logic specification, not limited to adversarial robustness.
  • To offer an alternative to iterative adversarial training by directly synthesizing safe, verified network parameters using formal methods.

Proposed method

  • Formulates the neural network repair problem as a satisfiability modulo theories (SMT) problem, encoding network structure and safety specifications as logical constraints.
  • Uses existential quantification over a small subset of network weights (e.g., w21, bias21) to search for valid parameter assignments that satisfy the specification.
  • Encodes ReLU activation functions using if-then-else constructs in the SMT formula to model piecewise linear behavior.
  • Applies SMT solvers to determine whether a safe parameter assignment exists; returns SAT if repair is possible, UNSAT otherwise.
  • Employs heuristics to improve computational efficiency, such as pruning search space and selecting optimal weights to free for repair.
  • Supports generalization to any decidable first-order logic specification, enabling application beyond adversarial robustness.

Experimental results

Research questions

  • RQ1Can SMT solvers be effectively used to automatically repair neural networks that fail to meet safety specifications?
  • RQ2To what extent can the repair process preserve the original network’s accuracy and decision boundaries?
  • RQ3How does the proposed SMT-based repair method compare in effectiveness and efficiency to adversarial training and naive baselines?
  • RQ4What is the scalability of the framework to larger or more complex neural network architectures?
  • RQ5Can the framework be generalized to enforce arbitrary decidable first-order logic specifications beyond adversarial robustness?

Key findings

  • The proposed framework successfully repairs small-sized neural networks (up to a few hundred parameters) to achieve adversarial robustness with only a mild loss in accuracy.
  • The method produces provably correct neural network representations by directly synthesizing safe weights via SMT solving, avoiding iterative retraining.
  • Experiments show the framework outperforms a naive baseline in both repair success rate and accuracy preservation.
  • The framework is general and can enforce any decidable first-order logic specification, not limited to adversarial robustness.
  • Heuristics such as strategic weight selection and solver tuning improve computational performance, enabling exploration of more realistic benchmarks.
  • The SMT encoding successfully captures piecewise linear ReLU networks and enables formal verification of safety properties through constraint solving.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.