  This paper introduces an algorithm for approximating the invariant set of
closed-loop controlled dynamical systems identified using ReLU neural networks
or piecewise affine PWA functions, particularly addressing the challenge of
providing safety guarantees for ReLU networks commonly used in safety-critical
applications. The invariant set of PWA dynamical system is estimated using ReLU
networks or its equivalent PWA function. This method entails formulating the
barrier function as a PWA function and converting the search process into a
linear optimization problem using vertices. We incorporate a domain refinement
strategy to increase flexibility in case the optimization does not find a valid
barrier function. Moreover, the objective of optimization is to maximize the
invariant set based on the current partition. Our experimental results
demonstrate the effectiveness and efficiency of our approach, demonstrating its
potential for ensuring the safety of PWA dynamical systems.
