Canonical foliations of neural networks: application to robustness