Dynamical Systems-Based Neural Networks

Elena Celledoni, Davide Murari, Brynjulf Owren, Carola-Bibiane Schönlieb, Ferdia Sherry · DOI

This paper, titled "Dynamical systems' based neural networks," offers a rigorous mathematical bridge between the world of Ordinary Differential Equations (ODEs) and deep learning architectures. By viewing neural networks—specifically Residual Networks (ResNets)—as discretized dynamical systems, the authors provide a systematic framework for "baking in" desirable mathematical properties like robustness, energy conservation, and mass preservation directly into the network's design.

TL;DR

The authors propose a framework to design neural networks by discretizing ODEs with specific geometric structures. This allows them to create architectures that are inherently 1-Lipschitz (robust to noise), symplectic (energy-conserving), or mass-preserving, while proving that these constraints do not sacrifice the network's ability to approximate any complex function.

What Problem Does This Paper Address?

Deep learning has seen massive empirical success, but we often don't fully understand why certain architectures work or how to guarantee they will behave well under pressure. For instance, standard neural networks are notoriously sensitive to adversarial attacks—tiny, calculated perturbations to input data that can flip a model's prediction.

While researchers have tried to impose constraints (like limiting the Lipschitz constant to ensure stability), these efforts are often ad hoc and can severely limit a model's "expressivity"—its ability to learn complex patterns. This paper tackles the challenge of imposing hard mathematical constraints without breaking the model's fundamental power.

Methods

The core idea is to treat a ResNet as a numerical approximation of a continuous-time dynamical system: $\dot{x}(t) = f(x(t), \theta(t))$.

  1. Dynamical Blocks: Instead of standard layers, the authors use "dynamical blocks" derived from specific vector fields.
  2. Structure-Preserving Discretization: They use numerical integration schemes (like the Euler method or splitting methods) that are guaranteed to preserve the properties of the underlying ODE.
  3. The Balancing Act (1-Lipschitz): To create robust 1-Lipschitz networks, they introduce a novel strategy: alternating between contractive layers (which pull points together) and expansive layers (which push them apart). By carefully timing these transitions, the overall block remains stable (1-Lipschitz) even if individual layers are not.
  4. Presnov Decomposition: They prove universal approximation theorems by showing that any continuous function can be approximated by composing flow maps of gradient vector fields and sphere-preserving vector fields.
Representation of a ResNet made of dynamical blocks and lifting/projection layers

Datasets

The authors validated their approach across several domains:

  • Image Classification: CIFAR-10 and CIFAR-100 were used to test adversarial robustness.
  • Synthetic Geometry: A 2D dataset of concentric rings was used to test the efficiency of alternating vector fields.
  • Epidemiology Modeling: Trajectories from the SIR (Susceptible-Infectious-Recovered) model were used to demonstrate mass-preserving architectures.

Key Insights and Ideas

  • Expressivity through Expansion: A major "aha" moment is that you don't need every layer to be contractive to have a stable network. Allowing "expansive" regimes within a controlled dynamical block provides the "freedom" the network needs to learn complex boundaries while maintaining an overall stability guarantee.
  • Physics as a Blueprint: By choosing Hamiltonian vector fields and symplectic integrators, you can build networks that naturally respect conservation laws, making them ideal for modeling physical systems.
  • Discretization Matters: The paper emphasizes that it's not enough to have a continuous model with good properties; the way you turn that model into discrete computer code (discretization) must also be "structure-preserving" to maintain those guarantees.

Key Results

  • Robustness vs. Accuracy: On CIFAR-10, their "flexible switching" strategy achieved a better tradeoff between clean accuracy and adversarial robustness compared to standard ResNets and naively constrained 1-Lipschitz models.
  • Efficiency: In 2D classification tests, alternating between different vector field families allowed the network to reach high accuracy (98%+) with a much smaller "integration time" $T$, meaning the transformation of data was more efficient.
Table showing median accuracy and integration time for different vector field families
  • Interpretable Physics: The mass-preserving architecture successfully modeled the SIR epidemic trajectories while strictly ensuring the total population percentage remained 100% at every step, a property standard networks often violate.

Limitations and Future Work

  • The Adversarial Gap: While these structured networks are significantly more robust than standard ones, they do not yet outperform models trained with adversarial training (a computationally expensive process of training on "attacked" images). The authors suggest that combining their architecture with adversarial training is a promising next step.
  • Implicit Methods: The current work focuses on explicit numerical methods. Exploring implicit geometric integrators could unlock even more stable and complex properties.
  • Optimization Strategies: The authors note that training these constrained architectures can be tricky and suggest that developing specialized optimization algorithms for these "dynamical blocks" could further improve performance.

Summary updated

BibTeX
@article{celledoni2023dynamical,
  author = {Elena Celledoni and Davide Murari and Brynjulf Owren and Carola-Bibiane Schönlieb and Ferdia Sherry},
  title = {{Dynamical Systems-Based Neural Networks}},
  journal = {SIAM J. Sci. Comput.},
  year = {2023},
  doi = {10.1137/22m1527337},
}
Figure