Causality analysis for neural network security