Formalizing Piecewise Affine Activation Functions of Neural Networks in Coq

Andrei Aleksandrov, Kim Völlinger
1/30/2023
cs.LG

No official code found. Best implementation: verinncoq/formalizing-pwa (6 stars, Apache-2.0, last commit 2023-03-14).

Abstract

Verification of neural networks relies on activation functions being piecewise affine (pwa) -- enabling an encoding of the verification problem for theorem provers. In this paper, we present the first formalization of pwa activation functions for an interactive theorem prover tailored to verifying neural networks within Coq using the library Coquelicot for real analysis. As a proof-of-concept, we construct the popular pwa activation function ReLU. We integrate our formalization into a Coq model of neural networks, and devise a verified transformation from a neural network N to a pwa function representing N by composing pwa functions that we construct for each layer. This representation enables encodings for proof automation, e.g. Coq's tactic lra -- a decision procedure for linear real arithmetic. Further, our formalization paves the way for integrating Coq in frameworks of neural network verification as a fallback prover when automated proving fails.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A Neural Network Model in Coq with a Formalization of Piecewise Affine Activation Functions

60Coq, PowerShellDec 29, 20223 years agoApache-2.0

Cite this paper

@article{aleksandrov2023formalizing,
  title  = {Formalizing Piecewise Affine Activation Functions of Neural Networks in Coq},
  author = {Andrei Aleksandrov and Kim Völlinger},
  year   = {2023},
  eprint = {2301.12893},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.12893v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2301.12893.svg)](https://codeofpaper.com/paper/2301.12893)

Discussion