Mex-SIAM, Agosto, 2026, Oaxaca
Saúl Diaz Infante Velasco
saul.diazinfante@unison.mxAprendizaje automático de dinámicas estocásticas con PINN y S-NODEs
PINNs y SNODEs aplicados al crecimiento logístico en la producción de Kéfir.



Mex-SIAM, Agosto, 2026, Oaxaca
Saúl Diaz Infante Velasco
saul.diazinfante@unison.mx


Aprendizaje automático de dinámicas estocásticas con PINN y S-NODEs
PINNs y SNODEs aplicados al crecimiento logístico en la producción de Kéfir.

Contents
01
Modeling Transition: From ODE to SDE
02
Classical Numerical Approaches
03
Scientific Machine Learning (SciML)
04
Neural ODEs and SDEs
A journey through the integration of physical models and machine learning for stochastic bioprocesses.
05
Application: Bioprocess Case Study
Modeling transition:
ODE → SDE

















Two of the main approaches:








Numerical approximations for SDEs

drift
diffusion
Taylor explicit methods

drift
diffusion












[Sec. 1.2, Thm 1.2.2]
Discrete Brownian motion























Construction















References



Numerical Solvers for Stochastic Differential Equations
Classical simulation packages, statistical SDE toolboxes, differentiable solvers, and compiled/HPC workflows
| Package | Ecosystem | Solver focus | Best use in an SDE exposition |
|---|---|---|---|
| sde Stefano M. Iacus classic | R | Euler, Milstein, KPS, Milstein2, conditional density, Ozaki, Shoji, and exact-algorithm simulation. | Natural reference package for simulation and inference of diffusion processes in the statistical SDE tradition. [R1] [R2] |
| YUIMA Simulation and inference for stochastic processes inference | R | SDEs driven by Wiener processes, Lévy processes, fractional Brownian motion, plus CARMA, COGARCH, and point-process models. | Best for statistically oriented SDE workflows: model specification, simulation, quasi-likelihood inference, hypothesis testing, change-point analysis, and high-frequency data methods. [R10] |
| Sim.DiffProc Simulation of diffusion processes | R | Euler-Maruyama, Milstein, predictor-corrector, Itô-Taylor, Heun, and stochastic Runge-Kutta schemes. | Good for a methods-oriented slide because the package makes the numerical hierarchy of strong and weak schemes explicit. [R3] |
MATLAB sde
Financial Toolbox
Picchini SDE Toolbox
|
MATLAB | Vector SDE models, drift/diffusion objects, Brownian risk sources, and Euler-type sample-path simulation. | MATLAB analogue for finance-oriented SDE simulation; the Picchini toolbox is useful as a historical simulation/inference reference. [R4] [R5] |
| sdeint NumPy/SciPy-style interface pedagogical | Python | Itô and Stratonovich integration: Euler-Maruyama, Heun, SRI2/SRS2, and Kloeden-Platen implicit methods. | Useful Python baseline for teaching classical schemes before moving to neural or differentiable SDE solvers. [R6] |
| torchsde Differentiable SDE solvers research | PyTorch | GPU-compatible SDE solvers, stochastic adjoint sensitivity, and neural SDE training workflows. | Best positioned when the exposition includes neural SDEs, backpropagation through stochastic dynamics, or learned drift/diffusion. [R7] [R8] |
| StochasticDiffEq.jl DifferentialEquations.jl ecosystem broadest | Julia | EM, Heun, SOSRI/SOSRA, weak-order methods, stiff solvers, commutative-noise methods, jump-diffusion, GPU ensembles. | Strong general-purpose open-source SDE solver ecosystem; ideal when solver breadth, adaptivity, callbacks, and performance matter. [R9] |
| XMDS2 C++ code generation HPC / SPDE | C/C++ | High-level model specification with generated, parallelized C++ code for stochastic systems. | Best presented as the compiled/HPC route rather than as a direct one-to-one analogue of Iacus’s scalar diffusion package. [R11] |
Suggested reading order: statistical SDE packages → MATLAB/Python baselines → differentiable solvers → Julia/HPC ecosystems.
References
Classical SDE simulation packages and MATLAB/Python baselines
References
Differentiable SDE solvers, SciML ecosystems, YUIMA, HPC, and numerical SDE foundations
Scientific Machine Learning (SciML)
State-of-the-Art SDE Software for SciML
Numerical solvers, neural SDEs, GPU acceleration, and model-code-generation tools
| Software | Stack | Numerical focus | SciML role and references |
|---|---|---|---|
| StochasticDiffEq.jl DifferentialEquations.jl ecosystem | Julia | EM, Heun, SOSRI/SOSRA, weak-order, stiff, and jump-diffusion methods. | Strong general-purpose SDE baseline for SciML; integrates with callbacks, AD workflows, events, and GPU ensembles. [R1] [R2] |
| torchsde Differentiable SDE solvers archived | PyTorch | Neural SDEs, adjoint sensitivities, Brownian reconstruction, reversible Heun. | Natural reference for neural SDE experiments and gradient-based learning of stochastic dynamics. [R3] [R4] |
| Diffrax JAX-native solver suite | JAX | Unified ODE/SDE/CDE solvers, adjoints, PyTrees, and vmappable workflows. | Good fit for differentiable simulation, neural differential equations, and hardware-accelerated JAX pipelines. [R5] |
| Boost.odeint Compiled numerical backend ODE core | C++ | Generic ODE steppers; useful for custom low-level stochastic time stepping. | Valuable when compiled control, C++ integration, or custom kernels matter; not an SDE-specialized SciML stack. [R6] |
| PyRates Model-code generation | Python | High-level model specification with backend code generation. | Useful for biological dynamical systems and reproducible model pipelines; better viewed as code generation than as a direct SDE solver. [R7] |
Click software names for documentation or repositories. Click reference tags for the corresponding paper or source.





Cybenko, G. Approximation by superpositions of a sigmoidal function. Math. Control, Signals Syst. 2, 303–314 (1989).




Solving With PINNs
Becouse each solution to the differential equation is obtained by solving an optimization problem.
This framework has strong overtones of collocation methods or finite element methods. This is a popular line of work.
Zubov, K. et al. NeuralPDE: Automating Physics-Informed Neural Networks (PINNs) with Error Approximations. arXiv (2021) doi:10.48550/arxiv.2107.09443.
Let
$$\frac{dy_{\theta}}{dt} = f(t, y_{\theta}(t)), \quad t \in (0, T],$$
with a known initial condition:
$$y_{\theta}(0) = y_0.$$
So, we want an NN \( y_{\theta}\) with parameters \(\theta\) that satisfies the above equation.
For tuning a given NN architecture, we define the Loss function
$$ L(\theta) = L_{\text{residual}} + \lambda L_{\text{IC}}.$$
We choose a set of collocation points,
\( \{t_i\}_{i=1}^{N}\), spread across the interval (0, T]. At each point, we compute the residual:
$$\text{Residual}(t_i) = \frac{dy_\theta}{dt}(t_i) - f(t_i, y_\theta(t_i)).$$
$$L_{\text{IC}} = |y_\theta(0) - y_0|^2$$
The Challenge: Simulating SDEs
Consider a general scalar SDE,
$$dX_t = f(X_t) dt + g(X_t) dW_t$$
Fokker-Planck equation (Kolmogorov forward):
$$\frac{\partial p}{\partial t} = -\frac{\partial}{\partial x} [f(x) p(x,t)] + \frac{1}{2} \frac{\partial^2}{\partial x^2} [g^2(x) p(x,t)]$$

Solving a SDE: classic numerics vs PINNs
Benchmark Example








































| Feature | Classic Methods | PINNs |
|---|---|---|
| Theory | Strong | Developing |
| Interpretability | High | Moderate |
| High Dimension | Hard | Better |
| Data Integration | Limited | Natural |
| Stability Guarantees | Yes | Often unclear |
References
- D. J. Higham. An algorithmic introduction to numerical simulation of stochastic differential equations. SIAM Review, 43(3):525–546, 2001. doi:10.1137/S0036144500378302
- M. Raissi, P. Perdikaris, and G. E. Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686–707, 2019. doi:10.1016/j.jcp.2018.10.045
- C.-W. Kong, L. Laurenti, J. McMahon, and M. Lahijanian. Error bounds for physics-informed neural networks in Fokker-Planck PDEs. In Proceedings of the Forty-first Conference on Uncertainty in Artificial Intelligence, Proceedings of Machine Learning Research, volume 286, pages 2291–2324, 2025. PMLR source
Neural ODEs and Neural SDEs
Neural ODEs
A neural ordinary differential equation is a differential equation in which a neural network parameterizes the vector field.
The central idea now is to use a differential equation solver as part of a learned, differentiable computational graph (the sort of graph ubiquitous in deep learning).
Chen et al. Neural Ordinary Differential Equations. in Advances in Neural Information Processing Systems (eds. Bengio, S. et al.) vol. 31 (2018).
Minimizing the loss function can be achieved using gradient-based methods, then we need an effective approach to computing the gradient.
The adjoint equation from optimal control theory is one of the major tools.
The first derivation of the adjoint equation goes back to the idea of using Lagrangian formalism, where λ, the variable in the adjoint equation, plays a similar role as a Lagrange multiplier
Results that solving the adjoint equation backward in time provides the gradient of the loss.
\(y_0 \in \mathbb{R}^d\) and \( \theta \in \mathbb{R}^m \).
be continuous in \(t\), uniformly Lipschitz in \(y\), and continuously differentiable in \(y\).
Let
be the unique solution to
\[y(0) = y_0, \qquad \frac{d y}{d t}(t) = f_\theta(t, y(t))\]
Let\(L = L(y(T))\) be function of the terminal value \(y(T)\).
Then \(\frac{d L}{d y(t)} = a_y(t)\) and \(\frac{d L}{d \theta} = a_\theta(0)\),
where
\(a_y : [0, T] \to \mathbb{R}^d\)
solve

In sequence modeling and time-series analysis, the loss function is typically is a function of the state at multiple discrete time snapshots
The optimization problem then becomes:
Adjoint Method for Multi-Label Loss Functions
$$\left( \frac{\partial L}{\partial \theta} \right)_k = \sum_{i=1}^{N} \frac{\partial L}{\partial z(t_i)} \frac{\partial z(t_i)}{\partial \theta_k}$$
$$\frac{\partial z(t_i)}{\partial \theta_k} = \int_{t_0}^{t_N} \frac{\partial z(t)}{\partial \theta_k} \delta(t - t_i) dt$$
$$\left( \frac{\partial L}{\partial \theta} \right)_k = \int_{t_0}^{t_N} \frac{\partial z(t)}{\partial \theta_k} \left( \sum_{i=1}^{N} \frac{\partial L}{\partial z(t_i)} \delta(t - t_i) \right) dt$$
$$\left( \frac{\partial L}{\partial \theta} \right)_k = \left\langle \sum_{i=1}^{N} \frac{\partial L}{\partial z(t_i)} \delta(t - t_i), \frac{\partial z(t)}{\partial \theta_k} \right\rangle_{X^*, X}$$

By differentiating both sides of the restriction equation respect to \(\theta\)
Suppouse \(\lambda\) = \(\lambda(t)\) s.t.
Integrating by parts

Nerural-SDE
We simulate the SDE forward, obtain \(Z_T\) and compute the lossZTZ_T, compute a loss
L=ℓ(ZT),\mathcal L = \ell(Z_T)
However, the backward pass must use the same Brownian path as the forward pass.
Naively reversing an Itô SDE is not valid. The clean reverse-time construction uses the Stratonovich form:
For a fixed Brownian sample path, the Stratonovich SDE defines a stochastic flow

Backward reconstruction of the state
The inverse stochastic flow reconstructs the earlier state from the terminal state:

References: Physics-Informed Neural Networks & UQ
- Z. Zou, X. Meng, A. F. Psaros, and G. E. Karniadakis. NeuralUQ: A Comprehensive Library for Uncertainty Quantification in Neural Differential Equations and Operators. SIAM Review, 66(1):161–190, 2024. doi:10.1137/21M1446859
- A. F. Psaros, X. Meng, Z. Zou, L. Guo, and G. E. Karniadakis. Uncertainty Quantification in Scientific Machine Learning: Methods, Metrics, and Comparisons. Journal of Computational Physics, 477:111902, 2023. doi:10.1016/j.jcp.2022.111902
- M. Raissi, P. Perdikaris, and G. E. Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686-707, 2019. doi:10.1016/j.jcp.2018.10.045
References: Neural ODEs & SDEs
- R. T. Q. Chen, Y. Rubanova, J. Bettencourt, and D. K. Duvenaud. Neural ordinary differential equations. Advances in Neural Information Processing Systems, 31, 2018. NeurIPS source
- E. Hairer, S. P. Nørsett, and G. Wanner. Solving ordinary differential equations I: Nonstiff problems. Springer Series in Computational Mathematics, volume 8, second edition, Springer, 1993. doi:10.1007/978-3-540-78862-1
- P. Kidger, R. T. Q. Chen, and T. J. Lyons. “Hey, that’s not an ODE”: Faster ODE adjoints via seminorms. In Proceedings of the 38th International Conference on Machine Learning, Proceedings of Machine Learning Research, 139:5443–5452, 2021. PMLR source
- X. Li, T. K. L. Wong, R. T. Q. Chen, and D. K. Duvenaud. Scalable gradients for stochastic differential equations. In Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), Proceedings of Machine Learning Research, 108:3870-3882, 2020. PMLR source
- P. Kidger, J. Foster, X. Li, and T. J. Lyons. Neural SDEs as Infinite-Dimensional GANs. In Proceedings of the 38th International Conference on Machine Learning, Proceedings of Machine Learning Research, 139:5453-5463, 2021. PMLR source
Fitting the data of water kefir production
Example with real data
Kefir Water production



Dr. José Carlos Rodríguez Figueroa
The right-hand side \(f_\theta\) is a fully connected neural network with input
\( (\tau,z) \in \mathbb R^2\), two hidden layers, 32 hidden units per layer, and
hyperbolic tangent activation:
Let \(\{\xi_m\}_{m=1}^M\) be \(M=128\) uniformly spaced collocation points in \([0,1]\).
The deterministic PINN
NODE fit










Evaluation Criteria
Water Kefir Model Comparison
| Model | RMSE ↓ | R2 ↑ | AIC ↓ | BIC ↓ | p | Main reading |
|---|---|---|---|---|---|---|
| Classical logistic ODE | 1.4291 | 0.9826 | 165.84 | 171.26 | 2 | Most parsimonious |
| Neural ODE | 1.0281 | 0.9910 | 2502.20 | 4644.90 | 1185 | Best in-sample fit |
| Neural SDE | 2.0312 | 0.9649 | 4933.48 | 9217.08 | 2370 | Uncertainty model |
| Deterministic logistic PINN | 2.8167 | 0.9326 | 4644.90 | 8641.24 | 2211 | Physics-constrained fit |
| Stochastic logistic PINN drift | 2.8469 | 0.9311 | 4647.87 | 8646.01 | 2212 | Logistic drift + noise estimate |
| Stochastic logistic SDE mean | 3.2324 | 0.9112 | 4659.30 | 8657.44 | 2212 | Mean of fitted stochastic process |
Stochastic Dynamics and PINN Parameters
| Stochastic-models | ||
|---|---|---|
| Model | 90% coverage ↑ | Mean width ↓ |
| Neural SDE | 0.9333 | 7.3887 |
| Stochastic logistic SDE | 0.8222 | 9.4517 |
| Estimated logistic PINN parameters | |||
|---|---|---|---|
| Model | r | K | σ |
| Deterministic logistic PINN | 0.035062 | 52.3350 | — |
| Stochastic logistic PINN/SDE | 0.036806 | 52.2809 | 0.017245 |


1.Baltazar-Larios, F., Delgado-Vences, F. & Ornelas, A. Parameter estimation and model selection for stochastic differential equations for biological growth. Environ. Ecol. Stat. 32, 195–227 (2025).
2.Baltazar-Larios, F., Delgado-Vences, F., Diaz-Infante, S. & Gomez, E. L. Statistical inference for a stochastic generalized logistic differential equation. Commun. Nonlinear Sci. Numer. Simul. 108261 (2024) doi:10.1016/j.cnsns.2024.108261.
3.Baltazar-Larios, F., Delgado-Vences, F. & Diaz-Infante, S. Maximum likelihood estimation for a stochastic SEIR system with a COVID-19 application. Int J Comput Math 1–23 (2022) doi:10.1080/00207160.2022.2148316.


MexSIAM Reunion Anual 2026 Oaxaca
By Saul Diaz Infante Velasco
MexSIAM Reunion Anual 2026 Oaxaca
Explore the fascinating intersection of machine learning and stochastic processes in bioprocesses, featuring innovative modeling techniques and cutting-edge numerical methods. Discover how advancements like Neural ODEs and PINNs can revolutionize simulations!
- 32