Sound and Complete Neural Network Repair with Minimality and Locality Guarantees

Feisi Fu, Wenchao Li

Abstract

We present a novel methodology for repairing neural networks that use ReLU activation functions. Unlike existing methods that rely on modifying the weights of a neural network which can induce a global change in the function space, our approach applies only a localized change in the function space while still guaranteeing the removal of the buggy behavior. By leveraging the piecewise linear nature of ReLU networks, our approach can efficiently construct a patch network tailored to the linear region where the buggy input resides, which when combined with the original network, provably corrects the behavior on the buggy input. Our method is both sound and complete—the repaired network is guaranteed to fix the buggy input, and a patch is guaranteed to be found for any buggy input. Moreover, our approach preserves the continuous piecewise linear nature of ReLU networks, automatically generalizes the repair to all the points including other undetected buggy inputs inside the repair region, is minimal in terms of changes in the function space, and guarantees that outputs on inputs away from the repair region are unaltered. On several benchmarks, we show that our approach significantly outperforms existing methods in terms of locality and limiting negative side effects.

Introduction: The Reliability Gap in Deep Learning

Deep Neural Networks (DNNs) are increasingly deployed in safety-critical systems, ranging from aircraft collision avoidance (ACAS Xu) to medical diagnostics. However, these models are prone to "bugs"—specific inputs or regions of the input space where the model produces incorrect or unsafe outputs. Traditionally, fixing these bugs involves retraining or fine-tuning the model with new data. This approach is often problematic due to high computational costs, the need for original training data, and the "Whack-A-Mole" problem: changing weights to fix one bug often introduces new errors elsewhere, a phenomenon known as negative side effects (NSE).

The REASSURE Framework: Surgical Repair

Researchers from Boston University have introduced REASSURE, a framework designed to repair buggy neural networks with mathematical guarantees. The core insight of REASSURE is that neural networks using ReLU activation functions are Continuous Piecewise Linear (CPWL). This means the model's input space is a collection of many small "linear regions" or convex polytopes.

Instead of tweaking the original weights and risking global instability, REASSURE constructs a localized Patch Network ($h_A$) that is added to the original network ($f$). The final repaired model is defined as $f(x) + h_A(x)$. Because the patch is designed to be zero outside the buggy area, the rest of the model remains entirely untouched.

Comparison of repair strategies: REASSURE (Our approach) maintains locality and continuity compared to retraining (global change) or decoupled methods (discontinuity).

How the Patch is Constructed

The repair process involves three primary components:

  1. Identify the Buggy Region: The algorithm identifies the specific linear region (polytope) where a buggy input resides.
  2. The Support Network ($g_A$): This sub-network acts as a localized mask. It outputs a value of 1 inside the buggy region and drops to 0 very quickly outside of it.
  3. The Affine Patch ($p_A$): A simple linear function designed to correct the error within that specific region.

To ensure the fix is "minimal," the authors utilize Robust Optimization. This allows them to solve for the best patch using Linear Programming (LP) without the computational burden of calculating every vertex of the complex buggy region, making it feasible for high-dimensional data.

A simplified representation of a patch network architecture used to implement localized corrections.

Key Advantages and Insights

REASSURE offers several properties that distinguish it from previous weight-modification or retraining techniques:

  • Soundness and Completeness: The method is "sound" (it is guaranteed to fix the identified bug) and "complete" (if a linear fix exists for the region, the algorithm will find it).
  • Function Space Minimality: Most repair methods try to minimize changes to weights. REASSURE minimizes changes to the output function. This ensures the model's behavior remains as close to the original as possible where it was already correct.
  • Feature-Space Repair: For high-dimensional datasets like ImageNet, the number of linear constraints can be overwhelming. The authors demonstrated that applying the patch to an intermediate "feature" layer maintains efficiency while preserving localized repair.
  • Zero Side Effects: In safety-critical benchmarks like HCAS, REASSURE achieved 0% Negative Side Effects, meaning it never broke a previously correct region while fixing a buggy one.

Experimental Validation

The authors evaluated REASSURE across several benchmarks, including MNIST, Watermark Removal, and the Horizontal Collision Avoidance System (HCAS).

On MNIST, REASSURE fixed buggy points with virtually no drop in overall test accuracy, whereas fine-tuning saw accuracy drops of up to 16%. In Watermark Removal tasks, REASSURE removed 100% of backdoors while maintaining 96.8% accuracy; a leading competitor's accuracy collapsed to 5.1% under the same conditions. Furthermore, the method is highly efficient: on the HCAS benchmark, REASSURE repaired 87 buggy regions in approximately 2.4 seconds.

Conclusion and Future Work

REASSURE represents a significant step toward verifiable and reliable neural network maintenance. By treating repair as a localized geometric problem rather than a global optimization problem, it provides the precision required for safety-critical applications. Future work will look into extending these mathematical principles to non-ReLU activation functions (like Sigmoid or Tanh) and automating the selection of the "steepness" parameter ($\gamma$) to further optimize the boundary between the patch and the original function space.

Summary updated

BibTeX
@inproceedings{fu2022sound,
  author = {Feisi Fu and Wenchao Li},
  title = {{Sound and Complete Neural Network Repair with Minimality and Locality Guarantees}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=xS8AMYiEav3},
}
Figure