Skip to main content

ZoPE: A Fast Optimizer for ReLU Networks with Low-Dimensional Inputs

  • Conference paper
  • First Online:
NASA Formal Methods (NFM 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13260))

Included in the following conference series:

  • 1803 Accesses

Abstract

Deep neural networks often lack the safety and robustness guarantees needed to be deployed in safety critical systems. Formal verification techniques can be used to prove input-output safety properties of networks, but when properties are difficult to specify, we rely on the solution to various optimization problems. In this work, we present an algorithm called ZoPE that solves optimization problems over the output of feedforward ReLU networks with low-dimensional inputs. The algorithm eagerly splits the input space, bounding the objective using zonotope propagation at each step, and improves computational efficiency compared to existing mixed-integer programming approaches. We demonstrate how to formulate and solve three types of optimization problems: (i) minimization of any convex function over the output space, (ii) minimization of a convex function over the output of two networks in series with an adversarial perturbation in the layer between them, and (iii) maximization of the difference in output between two networks. Using ZoPE, we observe a \(25\times \) speedup on property 1 of the ACAS Xu neural network verification benchmark compared to several state-of-the-art verifiers, and an \(85\times \) speedup on a set of linear optimization problems compared to a mixed-integer programming baseline. We demonstrate the versatility of the optimizer in analyzing networks by projecting onto the range of a generative adversarial network and visualizing the differences between a compressed and uncompressed network.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Source is at https://github.com/sisl/NeuralPriorityOptimizer.jl.

  2. 2.

    Source is at https://github.com/JuliaReach/LazySets.jl.

  3. 3.

    Available at https://www.gurobi.com and https://www.mosek.com.

  4. 4.

    https://sites.google.com/view/vnn20/vnncomp.

  5. 5.

    https://github.com/NeuralNetworkVerification/Marabou.

  6. 6.

    https://github.com/stanleybak/nnenum.

  7. 7.

    https://github.com/eth-sri/eran.

  8. 8.

    https://github.com/sisl/NeuralPriorityOptimizer.jl.

References

  1. Bojarski, M., et al.: End to end learning for self-driving cars, Technical Report (2016). http://arxiv.org/abs/1604.07316

  2. Julian, K.D., Kochenderfer, M.J., Owen, M.P.: Deep neural network compression for aircraft collision avoidance systems. AIAA J. Guid. Control Dyn. 42(3), 598–608 (2019)

    Article  Google Scholar 

  3. Liu, C., Arnon, T., Lazarus, C., Strong, C., Barrett, C., Kochenderfer, M.J.: Algorithms for verifying deep neural networks. Found. Trends® Optim. 4(3–4), 244–404 (2021)

    Google Scholar 

  4. Katz, S.M., Corso, A.L., Strong, C.A., Kochenderfer, M.J.: Verification of image-based neural network controllers using generative models. In: Digital Avionics Systems Conference (DASC) (2021)

    Google Scholar 

  5. Julian, K.D., Lee, R., Kochenderfer, M.J.: Validation of image-based neural network controllers through adaptive stress testing (2020)

    Google Scholar 

  6. Katz, S.M., Julian, K.D., Strong, C.A., Kochenderfer, M.J.: Generating probabilistic safety guarantees for neural network controllers. Mach. Learn. , 1–29 (2021). https://doi.org/10.1007/s10994-021-06065-9

  7. Kynkäänniemi, T., Karras, T., Laine, S., Lehtinen, J., Aila, T.: Improved precision and recall metric for assessing generative models. In: Advances in Neural Information Processing Systems (NeurIPS) (2019)

    Google Scholar 

  8. Mirman, M., Gehr, T., Vechev, M.: Robustness certification with generative models. In: ACM SIGPLAN International Conference on Programming Language Design and Implementation (2021)

    Google Scholar 

  9. Strong, C.A., et al.: Global optimization of objective functions represented by ReLU networks. Mach. Learn. 2010.03258 (2021). https://doi.org/10.1007/s10994-021-06050-2

  10. Singh, G., Gehr, T., Püschel, M., Vechev, M.T.: Boosting robustness certification of neural networks. In: International Conference on Learning Representations (2019)

    Google Scholar 

  11. Bak, S., Tran, H.-D., Hobbs, K., Johnson, T.T.: Improved geometric path enumeration for verifying ReLU neural networks. In: Lahiri, S.K., Wang, C. (eds.) CAV 2020. LNCS, vol. 12224, pp. 66–96. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-53288-8_4

    Chapter  Google Scholar 

  12. Katz, G., et al.: The Marabou framework for verification and analysis of deep neural networks. In: Dillig, I., Tasiran, S. (eds.) CAV 2019. LNCS, vol. 11561, pp. 443–452. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-25540-4_26

  13. Bunel, R., Mudigonda, P., Turkaslan, I., Torr, P., Lu, J., Kohli, P.: Branch and bound for piecewise linear neural network verification. J. Mach. Learn. Res. 21(2020), 1–39 (2020)

    MathSciNet  MATH  Google Scholar 

  14. Ehlers, R.: Formal verification of piece-wise linear feed-forward neural networks. In: D’Souza, D., Narayan Kumar, K. (eds.) ATVA 2017. LNCS, vol. 10482, pp. 269–286. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-68167-2_19

    Chapter  Google Scholar 

  15. Katz, G., Barrett, C., Dill, D.L., Julian, K., Kochenderfer, M.J.: Reluplex: an efficient SMT solver for verifying deep neural networks. In: Majumdar, R., Kunčak, V. (eds.) CAV 2017. LNCS, vol. 10426, pp. 97–117. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-63387-9_5

    Chapter  Google Scholar 

  16. Wang, S., Pei, K., Whitehouse, J., Yang, J., Jana, S.: Formal security analysis of neural networks using symbolic intervals. In: USENIX Security Symposium 2018, pp. 1599–1614 (2018)

    Google Scholar 

  17. Wu, H., et al.: Parallelization techniques for verifying neural networks. CoRR, vol. abs/2004.08440 (2020). arXiv: 2004.08440

  18. Tjeng, V., Xiao, K., Tedrake, R.: Evaluating robustness of neural networks with mixed integer programming. In: International Conference on Learning Representations (2017)

    Google Scholar 

  19. Singh, G., Gehr, T., Mirman, M., Püschel, M., Vechev, M.T.: Fast and effective robustness certification. In: Advances in Neural Information Processing Systems (NeurIPS) (2018)

    Google Scholar 

  20. Singh, G., Gehr, T., Püschel, M., Vechev, M.: An abstract domain for certifying neural networks. In: Proceedings of the ACM on Programming Languages, vol. 3, no. POPL, pp. 1–30 (2019)

    Google Scholar 

  21. Fujishige, S.: Submodular Functions and Optimization. Elsevier (2005)

    Google Scholar 

  22. Kitahara, T., Sukegawa, N.: A simple projection algorithm for linear programming problems. Algorithmica 81(1), 167–178 (2019)

    Article  MathSciNet  Google Scholar 

  23. Lawler, E.L., Wood, D.E.: Branch-and-bound methods: a survey. Oper. Res. 14(4), 699–719 (1966)

    Article  MathSciNet  Google Scholar 

  24. Kochenderfer, M.J., Wheeler, T.A.: Algorithms for Optimization. MIT Press, Cambridge (2019)

    Google Scholar 

  25. Althoff, M., Stursberg, O., Buss, M.: Reachability analysis of nonlinear systems with uncertain parameters using conservative linearization. In: IEEE Conference on Decision and Control (CDC), pp. 4042–4048 (2008)

    Google Scholar 

  26. Rubies-Royo, V., Calandra, R., Stipanovic, D.M., Tomlin, C.: Fast neural network verification via shadow prices. arXiv preprint arXiv:1902.07247 (2019)

  27. Yuan, X., He, P., Zhu, Q., Li, X.: Adversarial examples: attacks and defenses for deep learning. IEEE Trans. Neural Netw. Learn. Syst. 30(9), 2805–2824 (2019)

    Article  MathSciNet  Google Scholar 

  28. Althoff, M., Frehse, G.: Combining zonotopes and support functions for efficient reachability analysis of linear systems. In: IEEE Conference on Decision and Control (CDC), pp. 7439–7446 (2016)

    Google Scholar 

  29. Althoff, M.: On computing the Minkowski difference of zonotopes. arXiv preprint arXiv:1512.02794 (2015)

  30. Lomuscio, A., Maganti, L.: An approach to reachability analysis for feedforward ReLU neural networks. arXiv preprint arXiv:1706.07351 (2017)

  31. Singh, G., Ganvir, R., Püschel, M., Vechev, M.: Beyond the single neuron convex barrier for neural network certification. In: Advances in Neural Information Processing Systems (NeurIPS), vol. 32, pp. 15 098–15 109 (2019)

    Google Scholar 

Download references

Acknowledgments

We would like to acknowledge support from Eric Luxenberg, Haoze Wu, Gagandeep Singh, Chelsea Sidrane, Joe Vincent, Changliu Liu, Tomer Arnon, and Katherine Strong.

Funding in support of this work is from DARPA under contract FA8750-18-C-009, the NASA University Leadership Initiative (grant #80NSSC20M0163), and the National Science Foundation Graduate Research Fellowship under Grant No. DGE-1656518. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of DARPA, any NASA entity, or the National Science Foundation.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christopher A. Strong .

Editor information

Editors and Affiliations

A Appendix

A Appendix

1.1 A.1 Maximum Distance Between Points in Two Hyperrectangles

We would like to derive an analytical solution for the maximum distance given by a p-norm with \(p \ge 1\) between two hyperrectangles \(H_1\) and \(H_2\). We will let \(\mathbf {c}_1\) and \(\mathbf {c}_2\) be the centers of \(H_1\) and \(H_2\), and \(\mathbf {r}_1\) and \(\mathbf {r}_2\) be the radii of \(H_1\) and \(H_2\). The maximum distance can be found by solving the following optimization problem

$$\begin{aligned} \begin{array}{ll} \underset{\mathbf {h}_1, \mathbf {h}_2}{\text {maximize}} &{}\quad \left\Vert \mathbf {h}_1 - \mathbf {h}_2\right\Vert _p \\ \text {subject to} &{}\;\;\; \mathbf {h}_1 \in H_1 \\ &{}\;\;\; \mathbf {h}_2 \in H_2 \end{array} \end{aligned}$$

The p-norm for finite p is defined as

$$ \left\Vert \mathbf {x}\right\Vert _p = (\sum _{i=1}^n |(\mathbf {x})_i|^p)^{\frac{1}{p}} $$

We expand the objective of our maximization problem to be

$$ (\sum _{i=1}^n (|(\mathbf {h}_1)_i - (\mathbf {h}_2)_i|^p))^{\frac{1}{p}} $$

and since \(x^\frac{1}{p}\) is monotonically increasing on the non-negative reals for \(p \ge 1\), we can remove the power of \(\frac{1}{p}\) giving us the equivalent problem

$$\begin{aligned} \begin{array}{ll} \underset{\mathbf {h}_1, \mathbf {h}_2}{\text {maximize}} &{}\quad \sum _{i=1}^n (|(\mathbf {h}_1)_i - (\mathbf {h}_2)_i|^p) \\ \text {subject to} &{}\;\;\; \mathbf {h}_1 \in H_1 \\ &{}\;\;\; \mathbf {h}_2 \in H_2 \end{array} \end{aligned}$$
(10)

Now we see that the constraints \(\mathbf {h}_1 \in H_1\) and \(\mathbf {h}_2 \in H_2\) apply independent constraints to each dimension of \(\mathbf {h}_1\) and \(\mathbf {h}_2\). We also note that the objective can be decomposed coordinate-wise. As a result, in order to solve this optimization problem, we will need to solve n optimization problems of the form

$$\begin{aligned} \begin{array}{ll} \underset{(\mathbf {h}_1)_i, (\mathbf {h}_2)_i}{\text {maximize}} &{}\quad |(\mathbf {h}_1)_i - (\mathbf {h}_2)_i|^p \\ \text {subject to} &{}\;\;\; (\mathbf {c}_1)_i - (\mathbf {r}_1)_i \le (\mathbf {h}_1)_i \le (\mathbf {c}_1)_i + (\mathbf {r}_1)_i\\ &{}\;\;\; (\mathbf {c}_2)_i - (\mathbf {r}_2)_i \le (\mathbf {h}_2)_i \le (\mathbf {c}_2)_i + (\mathbf {r}_2)_i \end{array} \end{aligned}$$
(11)

Since \(x^p\) is monotonically increasing for \(p \ge 1\) we can equivalently maximize \(|(\mathbf {h}_1)_i - (\mathbf {h}_2)_i|\). We show an analytic form for the maximum by checking cases. If \((\mathbf {c}_2)_i\) is larger than \((\mathbf {c}_1)_i\), the maximum will be found by pushing \((\mathbf {h}_2)_i\) to its upper bound and \((\mathbf {h}_1)_i\) to its lower bound. Conversely, if \((\mathbf {h}_1)_i\) is larger than \((\mathbf {h}_2)_i\), the maximum will be found by pushing \((\mathbf {h}_1)_i\) to its upper bound and \((\mathbf {h}_2)_i\) to its lower bound. If \((\mathbf {c}_1)_i\) is equal to \((\mathbf {c}_2)_i\), then we can arbitrarily choose one to push to its lower bound and the other to push to its upper bound—we select \((\mathbf {h}_1)_i\) to go to its upper bound and \((\mathbf {h}_2)_i\) to go to its lower bound. As a result we have the optimal inputs

$$\begin{aligned} (\mathbf {h}_1)_i^*&= (\mathbf {c}_1)_i + \text {sign}((\mathbf {c}_1)_i - (\mathbf {c}_1)_i) (\mathbf {r}_1)_i \\ (\mathbf {h}_2)_i^*&= (\mathbf {c}_2)_i + \text {sign}((\mathbf {c}_2)_i - (\mathbf {c}_2)_i) (\mathbf {r}_2)_i \end{aligned}$$

where the sign function is given by

$$ \text {sign}(x) = {\left\{ \begin{array}{ll} 1.0 &{} x \ge 0 \\ -1.0 &{} x < 0 \end{array}\right. } $$

Then, backtracking to our original problem and vectorizing gives us the analytical solution to this optimization problem with optimal value \(d^*\)

$$\begin{aligned} \mathbf {h}_1^*&= \mathbf {c}_1 + \text {sign}(\mathbf {c}_1 - \mathbf {c}_2) \odot \mathbf {r}_1 \\ \mathbf {h}_2^*&= \mathbf {c}_2 + \text {sign}(\mathbf {c}_2 - \mathbf {c}_1) \odot \mathbf {r}_2 \\ d^*&= \left\Vert \mathbf {h}_1^* - \mathbf {h}_2^*\right\Vert _p \end{aligned}$$

where the sign function is applied elementwise. This completes our derivation of the analytical solution for the maximum distance between two points contained in two hyperrectangles.

1.2 A.2 Verifier Configuration for the Collision Avoidance Benchmark

This section describes how each verifier was configured for the collision avoidance benchmark discussed in Sect. 5.1. Table 2 summarizes the non-default parameters for each solver and the location where the parameter was set. Both NNENUM and ERAN by default make use of parallelization, and Marabou has a parallel mode of operation, but for this experiment we restrict all tools to a single core. We ran the experiments on a single core to try to separate the aspects of how each solver was parallelized from what we viewed as the core of its algorithmic approach. We expect ZoPE would parallelize well, especially on more challenging problems. The hyperparameters we ran for ERAN may be better suited for multiple cores than a single core, so further comparison could explore these in more depth. Additionally, the timing results from the Verification of Neural Networks 2020 competitionFootnote 4 for several properties for ERAN were slower than we expected from the change in hardware and the restriction to a single core. Exploring the tool further, we observed that on several problem instances it would return back a failed status before reaching a timeout. On these same instances we saw that ERAN would find several inputs that were almost counter-examples, for example with a margin of \(1 \times 10^{-6}\) from violating the property, flag these as potential counter-examples, then move on. It is possible that the root cause of the abnormalities we observed affected timing results. On problems where ERAN did return a status the results were consistent with the ground truth.

The parameters were chosen based off of a mix of recommendations from developers on their best configuration for the collision avoidance benchmark or existing documented settings for this benchmark. For example, ERAN’s parameters were based off of the VNN20 competition as found at https://github.com/GgnDpSngh/ERAN-VNN-COMP/blob/master/tf_verify/run_acasxu.sh. The code for for Marabou,Footnote 5 NNENUM,Footnote 6 ERAN,Footnote 7 and our optimizer ZoPEFootnote 8 is available for free online.

Table 2. Non-default verifier parameters

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Strong, C.A., Katz, S.M., Corso, A.L., Kochenderfer, M.J. (2022). ZoPE: A Fast Optimizer for ReLU Networks with Low-Dimensional Inputs. In: Deshmukh, J.V., Havelund, K., Perez, I. (eds) NASA Formal Methods. NFM 2022. Lecture Notes in Computer Science, vol 13260. Springer, Cham. https://doi.org/10.1007/978-3-031-06773-0_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-06773-0_16

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-06772-3

  • Online ISBN: 978-3-031-06773-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics