Hybridising standard reduced-order modelling methods with interpretable sparse neural networks for real-time patient-specific lung simulations

VPH 2024 - Stuttgart

Alexandre Daby-Seesaram

LMS, École Polytechnique, Paris, France

Katerina Skardova

LMS, École Polytechnique, Paris, France

Martin Genet

LMS, École Polytechnique, Paris, France

September 4, 2024

Idiopathic Pulmonary Fibrosis

Inspiration & expiration of diseased lungs

Digital twin from images

Objectives

  • Improved understanding of the physiological mechanisms
  • In silico prognostics
    • Transfer tools to the clinic
    • Patient-specific digital twins

Requirements

  • Real-time estimation of the parameters

Lung poro-mechanics

\[ \begin{cases} \boldsymbol{\nabla}\cdot \mathcal{\boldsymbol{\sigma}}+ \boldsymbol{f} = 0 \qquad & \mathrm{in} \ \Omega \\ \mathcal{\boldsymbol{\sigma}}\cdot \boldsymbol{n} = \boldsymbol{F} & \text{on } \partial \Omega_{N} \\ \boldsymbol{u} = \boldsymbol{u}_d \qquad \qquad & \text{on } \partial \Omega_{d} \\ % \sigm = \ftensor{C}\left(\para\right):\eps(\vect{u}) & \mathrm{in} \ \Omega \end{cases} \label{eq:MechPb} \]

Reference problem

Behaviour

  • \(\boldsymbol{\Sigma} = \frac{\partial \Psi}{\partial \boldsymbol{E}}\)
  • \(\boldsymbol{\Sigma}\) Second Piola-Kirchhoff stress tensor
  • \(\boldsymbol{E}\) is the Green-Lagrange strain tensor

Simple mechanical problem - surrogate modelling

  • Parametrised (patient-specific) mechanical problem

\[ \begin{cases} \boldsymbol{\nabla}\cdot \mathcal{\boldsymbol{\sigma}}+ \boldsymbol{f}\left(\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right) = 0 \qquad & \mathrm{in} \ \Omega \\ \mathcal{\boldsymbol{\sigma}}\cdot \boldsymbol{n} = \boldsymbol{F}\left(\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right) & \text{on } \partial \Omega_{N} \\ \boldsymbol{u} = \boldsymbol{u}_d \qquad \qquad & \text{on } \partial \Omega_{d} \\ \end{cases} \label{eq:MechPb2} \]

Reference problem

Behaviour

  • \(\mathcal{\boldsymbol{\sigma}}= \mathbb{C}\left(\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right):\mathcal{\boldsymbol{\varepsilon}}(\boldsymbol{u})\)
  • \(\mathbb{C}\left(\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right)\) the parametrised Hooke’s tensor
  • \(\mathcal{\boldsymbol{\varepsilon}}(\boldsymbol{u})\) the linearised Green-Lagrange strain tensor
  • \(\mathcal{\boldsymbol{\sigma}}\) the Cauchy stress tensor

Reduced-order model (ROM)

  • Build a surrogate model
    • Parametrised solution
  • No computations online
  • On the fly evaluation of the model
    • Real-time parameters estimation

II - Methods

\[ \definecolor{BleuLMS}{RGB}{1, 66, 106} \definecolor{VioletLMS}{RGB}{77, 22, 84} \definecolor{TealLMS}{RGB}{0, 103, 127} % \definecolor{BleuLMS2}{RGB}{0, 103, 202} \definecolor{BleuLMS2}{RGB}{0, 169, 206} \definecolor{BleuLMPS}{RGB}{105, 144, 255} \definecolor{accentcolor}{RGB}{1, 66, 106} \definecolor{GreenLMS}{RGB}{0,103,127} \definecolor{LGreenLMS}{RGB}{67,176,42} \definecolor{RougeLMS}{RGB}{206,0,55} \]

  1. Mechanical solution interpolation
  1. Reduced-order modelling
  1. Hybrid Neural Network Proper Generalised Decomposition

Interpolation of the solution

  • FEM finite admissible space

\[ \mathcal{U}_h = \left\{\boldsymbol{u}_h \; | \; \boldsymbol{u}_h \in \text{Span}\left( \left\{ N_i^{\Omega}\left(\boldsymbol{x} \right)\right\}_{i \in \mathopen{~[\!\![~}1,N\mathclose{~]\!\!]}} \right)^d \text{, } \boldsymbol{u}_h = \boldsymbol{u}_d \text{ on }\partial \Omega_d \right\} \]

  • Interpretabilty
  • Kronecker propriety
    • Easy to prescribe Dirichlet boundary conditions
  • Fixed mesh
  • Physics Informed Neural Networks (PINNs)

\[ \boldsymbol{u} \left(x_{0,0,0} \right) = \sum\limits_{i = 0}^C \sum\limits_{j = 0}^{N_i} \sigma \left( \sum\limits_{k = 0}^{M_{i,j}} b_{i,j}+\omega_{i,j,k}~ x_{i,j,k} \right) \]

  • All interpolation parameters are trainable
  • Benefits from ML developments
  • Not easily interpretable
  • Difficult to prescribe Dirichlet boundary conditions
  • HiDeNN framework (Liu et al., 2023; Park et al., 2023; Zhang et al., 2021)
    • Best of both worlds
    • Reproducing FEM interpolation with constrained sparse neural networks
    • \(N_i^{\Omega}\) are SNN with constrained weights and biases
    • Fully interpretable parameters
    • Continuous interpolated field that can be automatically differentiated
    • Runs on GPUs

Illustration of Finite Element Neural Network Interpolation (FENNI)

Solving the mechanical problem

Solving the mechanical problems amounts to finding the continuous displacement field minimising the potential energy \[E_p\left(\boldsymbol{u}\right) = \frac{1}{2} \int_{\Omega}\mathcal{\boldsymbol{\varepsilon}}: \mathbb{C} : \mathcal{\boldsymbol{\varepsilon}}~\mathrm{d}\Omega- \int_{\partial \Omega_N}\boldsymbol{F}\cdot \boldsymbol{u} ~\mathrm{d}A- \int_{\Omega}\boldsymbol{f}\cdot\boldsymbol{u}~\mathrm{d}\Omega. \]

In practice

  • Compute the loss \(\mathcal{L} := E_p\)
  • Find the parameters minimising the loss
    • Rely on state-of-the-art optimizers (ADAM, LBFGS, etc.)

Degrees of freedom (Dofs)

  • Nodal values (standard FEM Dofs)
  • Nodal coordinates (Mesh adaptation)
    • hr-adaptivity

FEM computation & mesh adaptation

Von mises stress
Dofs (initially) \(569~438\)
Training time (s) \(7\)
GPU (V100) 1
CPUs 40

More details:

Katerina Skardova at 4pm tomorrow in 02.011

Reduced-order modelling (ROM)

Low-rank approximation of the solution to avoid the curse of dimensionality with \(\beta\) parameters

Full-order discretised model

  • \(N\) spatial shape functions
    • Span a finite spatial space of dimension \(N\)
  • Requires computing \(N\times \beta\) associated parametric functions

Reduced-order model

  • \(m \ll N\) spatial modes
    • Similar to global shape functions
    • Span a smaller space
  • Galerkin projection

Finding the reduced-order basis

Proper Generalised Decomposition (PGD)

PGD: (Chinesta et al., 2011; Ladevèze, 1985)

Tensor decomposition

  • Separation of variables
  • Low-rank \(m\)
  • \(\textcolor{BleuLMPS}{\overline{\boldsymbol{u}}_i(\boldsymbol{x})}\) Space modes
  • \(\textcolor{LGreenLMS}{\lambda_i^j(\mu^j)}\) Parameter modes

\[\textcolor{VioletLMS}{\boldsymbol{u}}\left(\textcolor{BleuLMPS}{\boldsymbol{x}}, \textcolor{LGreenLMS}{\mu}\right) = \sum\limits_{i=0}^{m}\textcolor{BleuLMPS}{\overline{u}_i\left(x\right)}\textcolor{LGreenLMS}{\lambda_i\left(\mu\right)}\]

Discretised problem

2D PGD
  • From \(N\times N_{\mu}\) unknowns to \(m\times\left(N + N_{\mu}\right)\)

Proper Generalised Decomposition (PGD)

PGD: (Chinesta et al., 2011; Ladevèze, 1985)

Tensor decomposition

  • Separation of variables
  • Low-rank \(m\)
  • \(\textcolor{BleuLMPS}{\overline{\boldsymbol{u}}_i(\boldsymbol{x})}\) Space modes
  • \(\textcolor{LGreenLMS}{\lambda_i^j(\mu^j)}\) Parameter modes

\[ \textcolor{VioletLMS}{\boldsymbol{u}}\left(\textcolor{BleuLMPS}{\boldsymbol{x}}, \textcolor{LGreenLMS}{\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}}\right) = \sum\limits_{i=1}^m \textcolor{BleuLMPS}{\overline{\boldsymbol{u}}_i(\boldsymbol{x})} ~\textcolor{LGreenLMS}{\prod_{j=1}^{\beta}\lambda_i^j(\mu^j)} \]

Discretised problem

3D PGD
  • From \(N\times\prod\limits_{j=1}^{~\beta} N_{\mu}^j\) unknowns to \(m\times\left(N + \sum\limits_{j=1}^{\beta} N_{\mu}^j\right)\)
  • Finding the tensor decomposition by minimising the strain energy \[ \left(\left\{\overline{\boldsymbol{u}}_i \right\}_{i\in \mathopen{~[\!\![~}1,m\mathclose{~]\!\!]}},\left\{\lambda_i^j \right\}_{ \begin{cases} i\in \mathopen{~[\!\![~}1,m\mathclose{~]\!\!]}\\ j\in \mathopen{~[\!\![~}1,\beta \mathclose{~]\!\!]} \end{cases} } \right) = \mathop{\mathrm{arg\,min}}_{ \begin{cases} \left(\overline{\boldsymbol{u}}_1, \left\{\overline{\boldsymbol{u}}_i \right\} \right) & \in \mathcal{U}\times \mathcal{U}_0 \\ \left\{\left\{\lambda_i^j \right\}\right\} & \in \left( \bigtimes_{j=1}^{~\beta} \mathcal{L}_2\left(\mathcal{B}_j\right) \right)^{m-1} \end{cases}} ~\underbrace{\int_{\mathcal{B}}\left[E_p\left(\boldsymbol{u}\left(\boldsymbol{x},\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right), \mathbb{C}, \boldsymbol{F}, \boldsymbol{f} \right) \right]\mathrm{d}\beta}_{\mathcal{L}} \label{eq:min_problem} \]

Proper Generalised Decomposition (PGD)

\[ \boldsymbol{u}\left(\boldsymbol{x}, \left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right) = \overline{\boldsymbol{u}}(\boldsymbol{x}) ~\prod_{j=1}^{\beta}\lambda^j(\mu^j) \]

\[ \boldsymbol{u}\left(\boldsymbol{x}, \left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right) = \textcolor{RougeLMS}{\sum\limits_{i=1}^{2}} \overline{\boldsymbol{u}}_{\textcolor{RougeLMS}{i}}(\boldsymbol{x}) ~\prod_{j=1}^{\beta}\lambda_{\textcolor{RougeLMS}{i}}^j(\mu^j) \]

\[ \boldsymbol{u}\left(\boldsymbol{x}, \left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}\right) = \sum\limits_{i=1}^{\textcolor{RougeLMS}{m}} \overline{\boldsymbol{u}}_i(\boldsymbol{x}) ~\prod_{j=1}^{\beta}\lambda_i^j(\mu^j) \]

Greedy algorithm

  1. Start with a single mode
  2. Minimise the loss until stagnation
  1. Add a new mode
  2. If loss decreases, continue training
  1. Else stop and return the converged model

The PGD is

  • An a priori ROM techniques
    • Building the model from scratch on the fly
  • No full-order computations
  • Reduced-order basis tailored to the specifics of the problem (Daby-Seesaram et al., 2023)

Note

  • Training of the full tensor decomposition, not only the \(m\)-th mode
  • Actual minimisation implementation of the PGD
  • No need to solve a new problem for any new parameter
    • The online stage is a simple evaluation of the tensor decomposition

Neural Network PGD

Graphical implementation of Neural Network PGD

\[ \boldsymbol{u}\left(\textcolor{BleuLMPS}{\boldsymbol{x}}, \textcolor{LGreenLMS}{\left\{\mu_i\right\}_{i \in \mathopen{~[\!\![~}1, \beta \mathclose{~]\!\!]}}}\right) = \sum\limits_{i=1}^m \textcolor{BleuLMPS}{\overline{\boldsymbol{u}}_i(\boldsymbol{x})} ~\textcolor{LGreenLMS}{\prod_{j=1}^{\beta}\lambda_i^j(\mu^j)} \]

Interpretable NN-PGD

  • No black box
    • Fully interpretable implementation
    • Great transfer learning capabilities
  • Straightforward implementation
    • Benefiting from current ML developments
  • Straightforward definition of the physical loss using auto-differentiation
def Loss(model,x,detJ,mu):
  
    u = model.space_mode(x)
    eps = torch.autograd.grad(u, x, grad_outputs=torch.ones_like(u))
    lmbda = model.parameter_mode(mu)
    W_int = torch.einsum('ij,ejm,eil,em,mp...,lp...,p->',C,eps,eps,detJ,lmbda,lmbda, mu)

    return 0.5*W_int/mu.shape[0]

NN-PGD

III - Preliminary results

  1. Surrogate model in use
  1. Training and convergence proprieties

Stiffness and external forces parametrisation

Illustration of the surrogate model in use

Mechanical problem 2D

Parameters

  • Parametrised stiffness \(E\)
  • Parametrised external force \(\boldsymbol{f} = \begin{bmatrix} ~ \rho g \sin\left( \theta \right) \\ -\rho g \cos\left( \theta \right) \end{bmatrix}\)

NeuROM

NN-PGD

  • Immediate evaluation of the surrogate model
  • Straightforward differentiation capabilities regarding the input parameters

Multi-level training

Multi-level training convergence

Strategy

  • The interpretability of the NN allows
    • Great transfer learning capabilities
      • Start with coarse (cheap) training
      • Followed by fine tuning, refining all modes
  • Extends the idea put forward by (Giacoma et al., 2015)

Note

  • The structure of the Tensor decomposition is kept throughout the multi-level training
  • Last mode of each level is irrelevant by construction
    • It is removed before passing onto the next refinement level

Neural Network PGD

  • Bi-stiffness structure with unknown
    • Stiffness jump \(\Delta E\)
    • Jump position \(\alpha\)
  • Greed strategy (training) of the surrogate model
    • \(9\) PGD modes
    • Mode addition when stagnation

Bi-stiffness NN-PGD parametrisation
Figure 1: Convergence plot NeuROM

Conclusion

Conclusion

  • Robust and straightforward general implementation of a NN-PGD
    • Interpretable
    • Benefits from all recent developments in machine learning
  • Surrogate modelling of parametrised PDE solution
    • Promising results on simple linear toy case

Perspectives for patient-specific applications

  • Implementation of the poro-mechanics lung model (Patte et al., 2022)
  • Parametrisation of the segmented geometries
    • Variational encoder to reduce the segmentation’s parametrisation’s dimensionnality
  • Application to real-time lung parameters estimation
  • Error quantification on the estimated parameters

Technical perspectives

  • 3D implementation
  • Publication of the code …
    • … to come shortly

References

Barrault, M., Maday, Y., Nguyen, N. C., & Patera, A. T. (2004). An “empirical interpolation” method: Application to efficient reduced-basis discretization of partial differential equations. Comptes Rendus Mathematique, 339(9), 667–672. https://doi.org/10.1016/j.crma.2004.08.006
Chatterjee, A. (2000). An introduction to the proper orthogonal decomposition. Current Science, 78(7), 808–817. https://www.jstor.org/stable/24103957
Chinesta, F., Ladeveze, P., & Cueto, E. (2011). A Short Review on Model Order Reduction Based on Proper Generalized Decomposition. Archives of Computational Methods in Engineering, 18(4), 395–404. https://doi.org/10.1007/s11831-011-9064-7
Daby-Seesaram, A., Fau, A., Charbonnel, P.-É., & Néron, D. (2023). A hybrid frequency-temporal reduced-order method for nonlinear dynamics. Nonlinear Dynamics, 111(15), 13669–13689. https://doi.org/10.1007/s11071-023-08513-8
Giacoma, A., Dureisseix, D., Gravouil, A., & Rochette, M. (2015). Toward an optimal a priori reduced basis strategy for frictional contact problems with LATIN solver. Computer Methods in Applied Mechanics and Engineering, 283, 1357–1381. https://doi.org/10.1016/j.cma.2014.09.005
Hansteen, O. E., & Bell, K. (1979). On the accuracy of mode superposition analysis in structural dynamics. Earthquake Engineering & Structural Dynamics, 7(5), 405–411. https://doi.org/10.1002/eqe.4290070502
Ladevèze, P. (1985). Sur une famille d’algorithmes en mécanique des structures. Comptes-Rendus Des Séances de l’Académie Des Sciences. Série 2, Mécanique, Physique, Chimie, Sciences de l’univers, Sciences de La Terre, 300(2).
Liu, Y., Park, C., Lu, Y., Mojumder, S., Liu, W. K., & Qian, D. (2023). HiDeNN-FEM: A seamless machine learning approach to nonlinear finite element analysis. Computational Mechanics, 72(1), 173–194. https://doi.org/10.1007/s00466-023-02293-z
Maday, Y., & Rønquist, E. M. (2002). A Reduced-Basis Element Method. Journal of Scientific Computing, 17(1), 447–459. https://doi.org/10.1023/A:1015197908587
Nouy, A. (2010). A priori model reduction through Proper Generalized Decomposition for solving time-dependent partial differential equations. Computer Methods in Applied Mechanics and Engineering, 199(23-24), 1603–1626. https://doi.org/10.1016/j.cma.2010.01.009
Park, C., Lu, Y., Saha, S., Xue, T., Guo, J., Mojumder, S., Apley, D. W., Wagner, G. J., & Liu, W. K. (2023). Convolution hierarchical deep-learning neural network (C-HiDeNN) with graphics processing unit (GPU) acceleration. Computational Mechanics, 72(2), 383–409. https://doi.org/10.1007/s00466-023-02329-4
Patte, C., Genet, M., & Chapelle, D. (2022). A quasi-static poromechanical model of the lungs. Biomechanics and Modeling in Mechanobiology, 21(2), 527–551. https://doi.org/10.1007/s10237-021-01547-0
Peyraut, A., & Genet, M. (2024, May). Quantification d’incertitudes pour la modélisation pulmonaire personnalisée. 16ème Colloque National En Calcul de Structures. https://hal.science/hal-04611023
Radermacher, A., & Reese, S. (2013). A comparison of projection-based model reduction concepts in the context of nonlinear biomechanics. Archive of Applied Mechanics, 83(8), 1193–1213. https://doi.org/10.1007/s00419-013-0742-9
Zhang, L., Cheng, L., Li, H., Gao, J., Yu, C., Domel, R., Yang, Y., Tang, S., & Liu, W. K. (2021). Hierarchical deep-learning neural networks: Finite elements and beyond. Computational Mechanics, 67(1), 207–230. https://doi.org/10.1007/s00466-020-01928-9