Abstract
Using vanilla NeuralODEs to model large and/or complex systems often fails due to two reasons: stability and convergence. NeuralODEs are capable of describing stable as well as instable dynamic systems. Selecting an appropriate numerical solver is not trivial, because NeuralODE properties change during training. If the NeuralODE becomes more stiff, a suboptimal solver may need to perform very small solver steps, which significantly slows down the training process. If the NeuralODE becomes too instable, the numerical solver might not be able to solve it at all, which causes the training process to terminate. Often, this is tackled by choosing a computationally expensive solver that is robust to instable and stiff ODEs, but at the cost of a significantly decreased training performance. Our method, on the other hand, allows to enforce ODE properties that fit a specific solver or application-related boundary conditions. Concerning the convergence behavior, NeuralODEs often tend to run into local minima, especially if the system to be learned is highly dynamic and/or oscillating over multiple periods. Because of the vanishing gradient at a local minimum, the NeuralODE is often not capable of leaving it and converging to the right solution. We present a technique to add knowledge of ODE properties based on eigenvalues—like (partly) stability, oscillation capability, frequency, damping and/or stiffness—to the training objective of a NeuralODE. We exemplify our method at a linear as well as a nonlinear system model and show that the presented training process is far more robust against local minima, instabilities and sparse data samples and improves training convergence and performance.
Introduction
Neural Ordinary Differential Equations (NeuralODEs) represent a powerful fusion of deep learning and physical modeling, where an Artificial Neural Network (ANN) defines the right-hand side of a differential equation. Despite their potential, modeling complex or highly dynamic systems with NeuralODEs presents two significant hurdles:
- Stability: During training, the ANN may define a system that is numerically "stiff" or unstable. This forces the numerical solver to take infinitesimally small steps, drastically slowing training, or causes the solver to fail entirely.
- Convergence: For oscillatory systems, standard training—which relies on trajectory matching—often falls into a "local minimum." Instead of capturing the complex wave, the model learns a simple flat line representing the average of the oscillation. At these points, the gradient vanishes, leaving the model unable to reach the correct solution.
Methodology: Eigen-informed Training
We propose incorporating prior physical knowledge into the training objective by analyzing the eigenvalues of the system's Jacobian matrix. This method provides a global view of the system's character (e.g., vibration speed, decay rate) rather than just local temporal errors.
The Workflow
- Jacobian Analysis: The Jacobian of the ANN is computed to extract the system matrix.
- Eigenvalue Computation: The QR algorithm identifies the system's fundamental modes.
- Analytical Sensitivities: To maintain differentiability, we provide analytical expressions for eigenvalue sensitivities. This is more computationally efficient and numerically stable than standard Automatic Differentiation (AD) through the solver.
- Custom Loss Terms: Researchers can utilize specific loss components: STB (Stability), FRQ (Frequency), DMP (Damping), and STF (Stiffness).
Results and Discussion
Escaping Local Minima
In tests involving a linear weakly-damped oscillator, standard NeuralODE training (SOL) consistently stagnated in a flat-line local minimum. By introducing eigenvalue-based constraints for frequency and damping, the model successfully identified the oscillation and matched the ground truth.
As illustrated in the loss curves, the eigen-informed approach allows the optimizer to bypass the plateaus that trap standard trajectory-matching methods. While the standard SOL loss plateaus at a local minimum, the variants utilizing frequency and damping priors achieve full convergence.
Robustness to Sparse Data and Instability
One of the most striking results is the method's performance with sparse data. Even when data is sampled below the Nyquist-Shannon limit, providing a frequency prior allows the NeuralODE to reconstruct the signal accurately. Additionally, the STB gradient stabilizes unstable systems almost immediately, preventing the solver failures that frequently plague vanilla NeuralODEs.
Conclusion
Eigen-informed NeuralODEs offer a robust solution to the stability and convergence issues inherent in standard NeuralODE training. By leveraging the global perspective of system eigenvalues, this method enables more efficient training, faster simulation times via stiffness control, and the ability to learn from sparse, highly dynamic datasets. Future work includes extending this framework to Neural Partial Differential Equations (NeuralPDEs) and nonlinear control design.
Summary updated