Efficient Preimage Approximation for Neural Network Certification

Anton Björklund, Mykola Zaitsev, Marta Kwiatkowska · OpenReview

Abstract: The growing reliance on artificial intelligence in safety- and security-critical applications demands effective neural network certification. A challenging real-world use case is "patch attacks", where adversarial patches or lighting conditions obscure parts of images, for example, traffic signs. A significant step towards certification against patch attacks was recently achieved using PREMAP, which uses under- and over-approximations of the preimage, the set of inputs that lead to a specified output, for the certification. While the PREMAP approach is versatile, it is currently limited to fully-connected neural networks of moderate dimensionality. In order to tackle broader real-world use cases, we present novel algorithmic extensions to PREMAP involving tighter bounds, adaptive Monte Carlo sampling, and improved branching heuristics. Firstly, we demonstrate that these efficiency improvements significantly outperform the original PREMAP and enable scaling to convolutional neural networks that were previously intractable. Secondly, we showcase the potential of preimage approximation methodology for analysing and certifying reliability and robustness on a range of use cases from computer vision and control.

Introduction

Neural networks are notoriously fragile. A "patch attack"—such as a piece of tape on a stop sign, graffiti, or a specific sunbeam hitting a sensor—can cause a model to misclassify critical objects. Certification aims to provide a mathematical guarantee that a model will remain correct for all possible variations within a certain range (e.g., any color combination in a specific square patch).

Examples of patch attacks on traffic signs, including lighting effects, graffiti, and occlusions.

The challenge lies in computing the preimage: identifying every possible input that results in a specific output (like "Stop Sign") requires working backward through thousands of non-linear neurons. Previous methods were either too slow or limited to small, fully connected networks. This research introduces significant algorithmic improvements to PREMAP, a tool for certifying neural network robustness by approximating these preimages.

Methodology

The authors extend the original PREMAP algorithm with four key efficiency boosters designed to overcome the scalability wall:

  1. New Branching Heuristics: When splitting a problem into sub-regions, the algorithm must choose which neuron to "stabilize" first. The authors introduced sophisticated metrics like "extra" and "area," which estimate how much a specific neuron contributes to the overall uncertainty of the output.
  2. Bound Tightening: They utilize LiRPA (Linear Relaxation-based Perturbation Analysis) to propagate tighter constraints backward through the network after a split, effectively pruning the search space.
  3. Adaptive Sampling (Hit-and-Run): As the search space shrinks into complex geometric shapes (polytopes), standard random sampling fails. They implemented GPU-accelerated hit-and-run sampling to efficiently generate valid test points within these narrow regions.
  4. Computational Shortcuts: The algorithm now detects "dead-end" branches early. If a sub-region contains no valid samples or only valid samples, it can be finalized immediately without expensive optimization.

Key Insights and Results

A critical finding of this work is that Convolutional Neural Networks (CNNs) are significantly harder to certify than fully connected networks. This is not merely due to parameter count, but because they contain vastly more "unstable" neurons—neurons that could be either active or inactive given the input range.

The three states of a ReLU neuron: Inactive, Active, and Unstable. Managing unstable neurons is key to scaling preimage approximation.

Despite these challenges, the algorithmic improvements yielded impressive results:

  • Massive Speedups: On reinforcement learning control tasks (e.g., LunarLander, CartPole), the new version is at least one order of magnitude faster than the original PREMAP.
  • CNN Scalability: The new version achieved a threefold increase in completion rates for "hard" certification cases within a 10-minute window, where the original tool was largely intractable.
  • Anytime Property: Unlike many formal verifiers that are "all or nothing," this method is "anytime." If stopped early, it still provides a valid (though looser) approximation, which is vital for real-time safety systems.
  • Quantitative XAI: The method proved effective for Explainability (XAI), matching the performance of state-of-the-art tools like SHAP in identifying critical image regions while providing stronger mathematical guarantees.

Conclusion

While this paper makes significant strides in scaling preimage approximation, the "curse of dimensionality" remains a challenge for very large CNNs with tens of thousands of unstable neurons. Future work will focus on moving beyond simple "box" perturbations to more realistic noise models and applying these techniques to high-stakes domains like biometric security and medical diagnosis.

Summary updated

Abstract

The growing reliance on artificial intelligence in safety- and security-critical applications demands effective neural network certification. A challenging real-world use case is "patch attacks", where adversarial patches or lighting conditions obscure parts of images, for example, traffic signs. A significant step towards certification against patch attacks was recently achieved using PREMAP, which uses under- and over-approximations of the preimage, the set of inputs that lead to a specified output, for the certification. While the PREMAP approach is versatile, it is currently limited to fully-connected neural networks of moderate dimensionality. In order to tackle broader real-world use cases, we present novel algorithmic extensions to PREMAP involving tighter bounds, adaptive Monte Carlo sampling, and improved branching heuristics. Firstly, we demonstrate that these efficiency improvements significantly outperform the original PREMAP and enable scaling to convolutional neural networks that were previously intractable. Secondly, we showcase the potential of preimage approximation methodology for analysing and certifying reliability and robustness on a range of use cases from computer vision and control.
BibTeX
@misc{bjorklund2025efficient,
  author = {Anton Björklund and Mykola Zaitsev and Marta Kwiatkowska},
  title = {{Efficient Preimage Approximation for Neural Network Certification}},
  year = {2025},
  eprint = {2505.22798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.22798},
}
Figure