Abstract
This paper presents Mechanistic Neural Networks, a neural network design for machine learning applications in the sciences. It incorporates a new Mechanistic Block in standard architectures to explicitly learn governing differential equations as representations, revealing the underlying dynamics of data and enhancing interpretability and efficiency in data modeling. Central to our approach is a novel Relaxed Linear Programming Solver (NeuRLP) inspired by a technique that reduces solving linear ODEs to solving linear programs. This integrates well with neural networks and surpasses the limitations of traditional ODE solvers enabling scalable GPU parallel processing. Overall, Mechanistic Neural Networks demonstrate their versatility for scientific machine learning applications, adeptly managing tasks from equation discovery to dynamic systems modeling. We prove their comprehensive capabilities in analyzing and interpreting complex scientific data across various applications, showing significant performance against specialized state-of-the-art methods.
Introduction
Scientific Machine Learning (SciML) seeks to combine the predictive power of deep learning with the interpretability of physical laws. Traditionally, this has involved a trade-off: standard neural networks act as "black boxes" with high flexibility but low transparency, while symbolic methods like SINDy offer interpretability but struggle with scalability and complex nonlinearities.
Mechanistic Neural Networks (MNNs) bridge this gap by embedding explicit differential equations directly into the neural architecture. By utilizing "Mechanistic Blocks," these networks learn governing equations as internal representations, providing a model that is both physically grounded and computationally efficient.
Methods: The Mechanistic Block and NeuRLP
The core innovation of MNNs is the Mechanistic Block, which forces the network to find a physically meaningful explanation for the data by using an Ordinary Differential Equation (ODE) as a bottleneck representation. Unlike standard Neural ODEs that learn implicit dynamics, MNNs learn explicit symbolic coefficients.
Architecture Components
- Mechanistic Encoder ($f_\theta$): A neural network that maps input data $x$ to the coefficients $\alpha$ of a family of ODEs.
- NeuRLP Solver: A novel, massively parallel GPU solver. Traditional ODE solvers (e.g., Runge-Kutta) are sequential, creating a computational bottleneck. NeuRLP reduces linear ODE solving to a Linear Programming (LP) problem, which is then relaxed into a differentiable Quadratic Program (QP). This enables step-parallelism and batch-parallelism, significantly accelerating training.
For nonlinear dynamics, MNNs employ a "consistency loss" strategy, treating nonlinear terms as auxiliary variables within the linear solver framework to maintain differentiability and speed.
Experimental Evaluation
The authors evaluated MNNs across several challenging scientific benchmarks to test both their discovery and forecasting capabilities:
- Equation Discovery: Recovering chaotic Lorenz systems and complex ODEs with rational functions and
tanhnonlinearities. - N-body Prediction: Modeling planetary trajectories using the JPL Horizons database (tracking the 25 largest bodies in our solar system).
- PDE Solving: Addressing 1D Korteweg-de Vries (KdV) and 2D Darcy Flow equations.
- Time-series Forecasting: Analyzing the Airplane Vibrations dataset (F-16 shaker data).
Key Insights and Results
- Computational Efficiency: NeuRLP achieved up to a 200x speedup compared to standard sequential solvers like
torchdiffeqon long-sequence tasks by leveraging GPU parallelism. - Interpretability and Discovery: MNNs successfully recovered exact equations for rational function ODEs—a task where SINDy often fails due to its reliance on a fixed linear basis.
- Predictive Accuracy: In planetary trajectory modeling, MNNs reduced evaluation loss by at least a factor of 10 compared to standard Neural ODEs.
- Generalization: MNNs outperformed specialized architectures like the Fourier Neural Operator (FNO) on 2D Darcy Flow tasks, achieving a lower RMSE (0.0065 vs 0.0070).
Conclusion
Mechanistic Neural Networks represent a significant advancement in SciML by turning temporal integration into a global optimization problem. By forcing neural networks to "think" in terms of explicit symbolic equations, MNNs provide a scalable and interpretable framework for scientific discovery. Future work will explore active learning strategies to further refine equation discovery through experimental falsification, mimicking the scientific method.
Paper Citation: Pervez, A., Locatello, F., & Gavves, E. (2024). Mechanistic Neural Networks for Scientific Machine Learning. arXiv:2402.13077v1 [cs.LG].
Summary updated