Robust Classification Using Contractive Hamiltonian Neural ODEs

Muhammad Zakwan, Liang Xu, Giancarlo Ferrari-Trecate

TL;DR

This paper introduces Contractive Hamiltonian Neural ODEs (CH-NODEs) that are inherently robust to input perturbations by leveraging contraction theory. These CH-NODEs offer built-in guarantees against exploding gradients during training, leading to more stable learning and improved performance on noisy data.

What Problem Does This Paper Address?

Deep neural networks (NNs), despite their impressive performance, are notoriously sensitive to small input perturbations. These perturbations, often referred to as adversarial attacks or noise, can lead to drastically incorrect outputs, undermining the reliability of NNs in real-world applications. While various methods exist to improve robustness, they often involve computationally expensive layerwise regularization or lack theoretical guarantees. Neural Ordinary Differential Equations (NODEs) offer a continuous-time framework for NNs, but their robustness against input perturbations also remains a challenge. This paper aims to bridge this gap by developing a class of NODEs that are provably robust by design.

Methods

The core innovation lies in combining the framework of Neural ODEs with the principles of contraction theory and Hamiltonian systems.

  • Contraction Theory: A dynamical system is contractive if all its solutions, starting from different initial conditions, converge exponentially fast. This property means that initial small differences (like input perturbations) diminish over time.
  • Hamiltonian Systems: These are a class of structured nonlinear systems that naturally exhibit energy dissipation. The authors leverage this property to design NODEs that are inherently contractive.
  • Contractive Hamiltonian Neural ODEs (CH-NODEs): The proposed CH-NODEs are formulated as a specific type of Hamiltonian system. By carefully tuning a scalar parameter and structuring the dynamics, they ensure contractivity by design. This means the network's architecture itself enforces robustness.
  • Non-Exploding Gradients: A key theoretical contribution is the proof that CH-NODEs inherently prevent exploding gradients during training. This is crucial for stable and efficient training, especially for deep networks.
  • Training: CH-NODEs can be trained using standard backpropagation, with an iterative procedure to update the contractivity parameter during training.

Datasets

  • MNIST: Used for evaluating the performance of CH-NODEs on a standard image classification task, specifically under noisy conditions.
  • 2D Binary Classification Dataset: A custom dataset used to visually demonstrate how contractivity improves robustness by comparing the behavior of a vanilla NODE and a CH-NODE with perturbed inputs.

Key Insights and Ideas

  • Contractivity as a Direct Robustness Mechanism: The paper elegantly shows that contractivity, a property from dynamical systems theory, can be directly engineered into NNs (specifically NODEs) to mitigate the impact of input perturbations.
  • Hamiltonian Systems as a Natural Fit: The inherent dissipative nature of Hamiltonian systems makes them a suitable foundation for building contractive dynamical systems, which in turn can form robust NODEs.
  • Built-in Robustness vs. Post-hoc Regularization: CH-NODEs offer robustness "by design," meaning it's an intrinsic property of the architecture, rather than an add-on regularization technique. This simplifies training and provides stronger theoretical guarantees.
  • Guaranteed Non-Exploding Gradients: The theoretical proof of non-exploding gradients is a significant practical advantage, addressing a common pain point in training deep NODEs.

Key Results

  • Improved Robustness on 2D Data: In a 2D binary classification task, CH-NODEs were able to maintain perfect classification with input perturbation balls of radius 0.7, compared to 0.21 for a vanilla NODE.
  • Superior Performance on Noisy MNIST: On the MNIST dataset corrupted with Gaussian and salt-and-pepper noise, CH-NODEs consistently outperformed standard ResNets and Hamiltonian Deep Neural Networks (H-DNNs) in terms of test accuracy across various noise levels and network depths. For instance, with N=12 layers and salt-and-pepper noise (σ=0.2), CH-NODEs achieved 72.82% accuracy, while H-DNNs reached 22.75%.
  • Numerical Validation of Non-Exploding Gradients: Experiments on a "Double circles" dataset showed that the norms of the Backward Sensitivity Matrices (BSMs) remained bounded during training, confirming the theoretical prediction of non-exploding gradients. The NODE achieved high accuracy (99.12% test accuracy) in this setting.

Limitations and Future Work

  • Iterative Parameter Update: While the iterative procedure for updating the contractivity parameter during training worked well in experiments, formal guarantees on its convergence are not provided.
  • Adversarial Attacks: The current work focuses on random noise. Future research is suggested to analyze the robustness of CH-NODEs against more sophisticated adversarial attacks and to explore discretization schemes that preserve contractivity.
  • Generalization to Other Architectures: While the paper focuses on NODEs, exploring how contractivity principles can be applied to other NN architectures remains an open area.

Summary updated

BibTeX
@inproceedings{zakwan2023robust,
  author = {Muhammad Zakwan and Liang Xu and Giancarlo Ferrari-Trecate},
  title = {{Robust Classification Using Contractive Hamiltonian Neural ODEs}},
  booktitle = {IEEE Control. Syst. Lett},
  year = {2023},
  url = {https://openreview.net/forum?id=kg_5W3UyZu},
}
Figure