Publications

Back to Peer-reviewed conference papers

Physics-Embedded Neural Networks: Graph Neural PDE Solvers with Mixed Boundary Conditions

Authors
M. Horie†, N. Mitsume
Published in
Neural Information Processing Systems (NeurIPS)
Year
2022
Type
Peer-reviewed conference papers
Link
https://doi.org/10.52202/068431-1687
arXiv
https://arxiv.org/abs/2205.11912
Topics
Machine learning and data science Tsunami and disaster mitigation Fluid dynamics
Keywords
Physics-embedded neural network Graph neural PDE solver Mixed boundary conditions Graph neural network Partial differential equation Fulfillment of boundary conditions E(n)-equivariance Implicit method Global interaction Speed–accuracy tradeoff
Note
採択率 25.6%
グラフィカルアブストラクト
グラフィカルアブストラクト

概要

境界条件付きの偏微分方程式(PDE)のような境界値問題で記述される物理現象を、学習して予測する方法として、グラフニューラルネットワーク(GNN)が有望です。しかし、既存のモデルは、こうした問題を信頼性高く予測するのに不可欠な境界条件を、十分に扱えていません。また、GNN は局所的につながる性質を持つので、頂点の間の相互作用が大域的になりやすい、長い時間の後の状態を精度よく予測するのは困難です。

本論文は、境界条件を考慮し、陰解法を使って長い時間の後の状態を予測する、物理を埋め込んだニューラルネットワーク(physics-embedded neural networks、PENN)を提案しています。PENN は E(n) 同変な GNN に基づいており、さまざまな形状で高い汎化性能を示します。混合境界条件(ディリクレ境界条件とノイマン境界条件)を満たすための部品として、境界エンコーダー、ディリクレ層、擬似逆のデコーダー、NeumannIsoGCN(NIsoGCN)を構成し、長い時間の後の状態を安定に予測するための大域的なつながりとして、ニューラル非線形ソルバーを提案しています。複雑な形状の流れの実験で、論文は、PENN がディリクレ境界条件を誤差なく満たし、よく最適化された古典的なソルバーと最先端の機械学習のモデルを、速度と精度のトレードオフで上回ると報告しています。論文は、PENN が、信頼でき、速く、正確な、GNN に基づく PDE ソルバーを実現するための有用な標準になりうると述べています。コードは https://github.com/yellowshippo/penn-neurips2022 で公開されています。

重要点

1. 混合境界条件を持つ PDE と、PENN の構成

論文は、次の一般的な形の、時間発展の PDE を対象にしています。

∂u∂t(t,x)=D(u)(t,x)(t,x)∈(0,T)×Ω(1)\frac{\partial \boldsymbol{u}}{\partial t}(t, \boldsymbol{x}) = \mathcal{D}(\boldsymbol{u})(t, \boldsymbol{x}) \qquad (t, \boldsymbol{x}) \in (0, T) \times \Omega \tag{1} u(t,x)=u^(t,x)(t,x)∈(0,T)×∂ΩDirichlet(3)\boldsymbol{u}(t, \boldsymbol{x}) = \hat{\boldsymbol{u}}(t, \boldsymbol{x}) \qquad (t, \boldsymbol{x}) \in (0, T) \times \partial\Omega_{\mathrm{Dirichlet}} \tag{3} f^(∇u(t,x),n(x))=0(t,x)∈(0,T)×∂ΩNeumann(4)\hat{\boldsymbol{f}}(\nabla \boldsymbol{u}(t, \boldsymbol{x}), \boldsymbol{n}(\boldsymbol{x})) = \boldsymbol{0} \qquad (t, \boldsymbol{x}) \in (0, T) \times \partial\Omega_{\mathrm{Neumann}} \tag{4}

ここで、tt は時刻、x\boldsymbol{x} は位置、TT は解析する時間の終わり、u\boldsymbol{u} は求める場、D\mathcal{D} は既知の微分作用素(非線形でもよく、空間の微分演算子を含む)、Ω\Omega は解析領域、∂ΩDirichlet\partial\Omega_{\mathrm{Dirichlet}} と ∂ΩNeumann\partial\Omega_{\mathrm{Neumann}} はディリクレ境界条件とノイマン境界条件を課す境界、n(x)\boldsymbol{n}(\boldsymbol{x}) は境界の上の点 x\boldsymbol{x} での法線ベクトルです。u^\hat{\boldsymbol{u}} と f^\hat{\boldsymbol{f}} は既知の関数です(論文は、記号の上の ^ で既知の関数を表しています)。式 (3) はディリクレ境界条件で、境界での値を制約として課します。式 (4) はノイマン境界条件に当たり、境界で、値の代わりに法線の方向の微分を課します。この 2 つを合わせて混合境界条件と呼びます。これに初期条件(原論文の式 (2))を加えた問題を解きます。

論文は、機械学習で PDE を解く既存の方法には、次の 2 つの改善の余地があると述べています。

  • ディリクレ境界条件とノイマン境界条件(混合境界条件)を、効率よく、証明できる形で満たす方法が必要です。ディリクレ境界条件は厳しい制約であり、違うディリクレ境界条件は、利用者が解きたい違う問題に対応するので、厳密に満たすことが不可欠です。境界条件を入力としてモデルに与える既存の方法では、モデルが境界条件を近似的に満たすように学習することは期待できても、ディリクレ境界条件のような厳しい制約を満たす保証はありません。
  • 相互作用が大域的になりやすい、長い時間の後の状態を予測するには、大域的な相互作用の扱いを強める必要があります。GNN は局所的につながる性質のため汎化性能に優れる一方で、大域的な相互作用を見落とすことがあります。

PENN は、エンコード–処理–デコード型の構成を採っています。境界条件の情報を含む入力の特徴をエンコードし、エンコードした空間で、境界条件を反映した GNN による非線形ソルバーの反復を行い、出力の空間で境界条件を満たすように注意深くデコードします(図 1)。PENN は、軽量な E(n) 同変な GNN である IsoGCN(Horie ら、2021)を基にしており、物理的な対称性を反映し、速い予測を実現します。

PENN の概要
図 1 提案手法 PENN の概要。入力の特徴をエンコーダーで、境界条件を境界エンコーダーでエンコードし、エンコードした空間で、E(n) 同変な GNN(ディリクレ層と NeumannIsoGCN)からなるニューラル非線形ソルバーを反復します。反復のたびにエンコードした境界条件を適用し、反復の後に擬似逆のデコーダーでデコードして、ディリクレ境界条件を満たします。出典:原論文 Fig. 1。

2. ディリクレ境界条件を厳密に満たす:境界エンコーダー、ディリクレ層、擬似逆のデコーダー

論文は、ニューラルネットワークの表現力は高い次元の空間へのエンコードから生まれ、その空間では、対応する境界条件は自明でないと述べています。エンコードした空間にある処理部の層で境界条件を扱わなければ、解の軌跡は、境界条件を満たす解から大きく離れうるので、エンコードした空間で境界条件を扱うことが、境界条件を満たす信頼できるニューラル PDE ソルバーに不可欠であるとしています。

変数と境界条件を同じエンコードした空間に置くため、論文は、変数と、対応するディリクレ境界条件に同じエンコーダーを使います。これを境界エンコーダーと呼びます。

hi=fencode(ui) in Ω,h^i=fencode(u^i) on ∂ΩDirichlet(11)\boldsymbol{h}_i = \boldsymbol{f}_{\mathrm{encode}}(\boldsymbol{u}_i) \text{ in } \Omega, \quad \hat{\boldsymbol{h}}_i = \boldsymbol{f}_{\mathrm{encode}}(\hat{\boldsymbol{u}}_i) \text{ on } \partial\Omega_{\mathrm{Dirichlet}} \tag{11}

ここで、fencode\boldsymbol{f}_{\mathrm{encode}} はエンコーダー、ui\boldsymbol{u}_i はメッシュの ii 番目の頂点(位置 xi\boldsymbol{x}_i)での u\boldsymbol{u} の値、hi\boldsymbol{h}_i はそれをエンコードした特徴、u^i\hat{\boldsymbol{u}}_i は ii 番目の頂点でのディリクレ境界条件の値、h^i\hat{\boldsymbol{h}}_i はそれをエンコードしたものです。論文は、メッシュをグラフとみなして扱っています。エンコードした空間では、次のディリクレ層で、ディリクレ境界条件を簡単に適用できます。

DirichletLayer⁡(hi)={hi,xi∉∂ΩDirichleth^i,xi∈∂ΩDirichlet(12)\operatorname{DirichletLayer}(\boldsymbol{h}_i) = \begin{cases} \boldsymbol{h}_i, & \boldsymbol{x}_i \notin \partial\Omega_{\mathrm{Dirichlet}} \\ \hat{\boldsymbol{h}}_i, & \boldsymbol{x}_i \in \partial\Omega_{\mathrm{Dirichlet}} \end{cases} \tag{12}

この層は、ディリクレ境界の上の頂点の特徴を、エンコードした境界条件の値に置き換えます。論文は、境界条件を満たさなくなるかもしれない処理部の演算の後に、境界条件を満たす状態に戻すために、この処理が必要であるとしています。処理部の層の後、論文は、次の条件を満たす関数で、隠れた特徴をデコードします。

fdecode∘fencode(u^i)=u^i on ∂ΩDirichlet(13)\boldsymbol{f}_{\mathrm{decode}} \circ \boldsymbol{f}_{\mathrm{encode}}(\hat{\boldsymbol{u}}_i) = \hat{\boldsymbol{u}}_i \text{ on } \partial\Omega_{\mathrm{Dirichlet}} \tag{13}

ここで、fdecode\boldsymbol{f}_{\mathrm{decode}} はデコーダーです。この条件によって、エンコードした境界条件が、元の物理空間の境界条件に対応します。任意の境界条件の値について式 (13) が成り立つことを求めると、fdecode∘fencode\boldsymbol{f}_{\mathrm{decode}} \circ \boldsymbol{f}_{\mathrm{encode}} は恒等写像になり、fdecode=fencode+\boldsymbol{f}_{\mathrm{decode}} = \boldsymbol{f}_{\mathrm{encode}}^{+} が得られます。論文は、これを擬似逆のデコーダーと呼んでいます。高い次元の空間へのエンコードは可逆とは限らないので、fencode+\boldsymbol{f}_{\mathrm{encode}}^{+} は擬似逆行列を使って作ります。たとえば、隠れ層が 1 つの多層パーセプトロン(MLP)では、重み行列の擬似逆行列と、活性化関数(LeakyReLU)の逆関数で作れることを、論文は付録 A.1 で示しています。

3. ノイマン境界条件を取り入れた NeumannIsoGCN

PENN の基になる IsoGCN は、E(n) 同変な(並進、回転、鏡映に対して同変な)GNN で、スカラー場をベクトル場に変換する層は、勾配の演算子に当たります。境界条件の扱いは、IsoGCN の対象外でした。IsoGCN の勾配の演算子は、粒子を使って PDE を解く LSMPS 法(least squares moving particle semi-implicit method)に由来します。論文は、LSMPS 法でノイマン境界条件を扱うために提案された壁境界のモデル(Matsunaga ら、2020)を、粒子の計算とは違って頂点がノイマン境界の上にある場合に合うように変え、次の NeumannIsoGCN(NIsoGCN)を作っています。

NIsoGCN0→1(ψ):=Mi−1[∑j∈Niψj−ψi∥xj−xi∥xj−xi∥xj−xi∥+winig^i]W(14)\mathrm{NIsoGCN}_{0 \to 1}(\psi) := \boldsymbol{M}_i^{-1} \left[ \sum_{j \in \mathcal{N}_i} \frac{\psi_j - \psi_i}{\lVert \boldsymbol{x}_j - \boldsymbol{x}_i \rVert} \frac{\boldsymbol{x}_j - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_j - \boldsymbol{x}_i \rVert} + w_i \boldsymbol{n}_i \hat{g}_i \right] \boldsymbol{W} \tag{14} Mi:=∑l∈Nixl−xi∥xl−xi∥⊗xl−xi∥xl−xi∥+wini⊗ni(15)\boldsymbol{M}_i := \sum_{l \in \mathcal{N}_i} \frac{\boldsymbol{x}_l - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_l - \boldsymbol{x}_i \rVert} \otimes \frac{\boldsymbol{x}_l - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_l - \boldsymbol{x}_i \rVert} + w_i \boldsymbol{n}_i \otimes \boldsymbol{n}_i \tag{15}

ここで、式 (14) は ii 番目の頂点での層の出力で、下付きの 0→10 \to 1 は、スカラー場(0 階のテンソル)を入力してベクトル場(1 階のテンソル)を出力する層であることを表します。ψ\psi は入力のスカラー場(ψi\psi_i は ii 番目の頂点での値)、Ni\mathcal{N}_i は ii 番目の頂点に隣接する頂点の集合(jj と ll はその中の頂点の番号)、Mi\boldsymbol{M}_i は式 (15) で定める行列、∥⋅∥\lVert \cdot \rVert はノルム、⊗\otimes はテンソル積、ni\boldsymbol{n}_i は ii 番目の頂点での法線ベクトル、g^i\hat{g}_i は xi\boldsymbol{x}_i でのノイマン境界条件の値、W\boldsymbol{W} は学習する行列、wi>0w_i > 0 はノイマン境界条件の制約の強さを調整する、学習しないパラメータです。論文は、さらに次のように述べています。

  • wi→∞w_i \to \infty では、与えたノイマン境界条件を ni\boldsymbol{n}_i の方向に厳密に満たしますが、(xj−xi)(\boldsymbol{x}_j - \boldsymbol{x}_i) の方向の微分が相対的に無視されがちになります。このため、論文は wiw_i を中程度の値に保ち、3 次元の空間の平らな面の境界の「外側」に、10 個程度の頂点が仮想的にあると考えて、wi=10.0w_i = 10.0 としています。
  • ノイマン境界の上にない頂点で ni=0\boldsymbol{n}_i = \boldsymbol{0} とすれば、NIsoGCN は元の IsoGCN に一致します。つまり、NIsoGCN は元の IsoGCN の素直な一般化です。
  • 元の IsoGCN と同じように、ベクトルや、より高い階数のテンソルにも一般化できます。このため、NIsoGCN は、PDE の D\mathcal{D} を構成する任意の空間の微分演算子を表せます(原論文の付録 A.2 は、勾配、発散、ラプラシアン、ヤコビアン、ヘッシアンとの対応を示しています)。

4. ニューラル非線形ソルバー:陰解法を、大域的な相互作用を持つ最適化として解く

時間の離散化の最も簡単な方法は陽的オイラー法で、u(t,xi)\boldsymbol{u}(t, \boldsymbol{x}_i) を、小さな増分 D(u)(t,xi)Δt\mathcal{D}(\boldsymbol{u})(t, \boldsymbol{x}_i) \Delta t で更新します(原論文の式 (5))。これに対して、陰的オイラー法は、次の式を解きます。

u(t+Δt,xi)=u(t,xi)+D(u)(t+Δt,xi)Δt(6)\boldsymbol{u}(t + \Delta t, \boldsymbol{x}_i) = \boldsymbol{u}(t, \boldsymbol{x}_i) + \mathcal{D}(\boldsymbol{u})(t + \Delta t, \boldsymbol{x}_i) \Delta t \tag{6}

ここで、Δt\Delta t は時間刻みです。式 (6) は、単に変数を更新するのではなく、元の PDE を数値的に満たすように解く式で、次のように非線形の最適化問題とみなせます。

R(v):=v−u(t,⋅)−D(v)Δt(7)\boldsymbol{R}(\boldsymbol{v}) := \boldsymbol{v} - \boldsymbol{u}(t, \cdot) - \mathcal{D}(\boldsymbol{v}) \Delta t \tag{7}

ここで、R(v)\boldsymbol{R}(\boldsymbol{v}) は離散化した PDE の残差ベクトル、v\boldsymbol{v} は未知の変数です。すべての頂点で R(v)(xi)=0\boldsymbol{R}(\boldsymbol{v})(\boldsymbol{x}_i) = \boldsymbol{0} となる v\boldsymbol{v}(原論文の式 (8) の解)が、u(t+Δt,⋅)\boldsymbol{u}(t + \Delta t, \cdot) に当たります。この最適化問題は、簡単には、次の勾配降下法で解けます。

v(0):=u(t,⋅),v(i+1):=v(i)−α(i)R(v(i))(9)\boldsymbol{v}^{(0)} := \boldsymbol{u}(t, \cdot), \quad \boldsymbol{v}^{(i+1)} := \boldsymbol{v}^{(i)} - \alpha^{(i)} \boldsymbol{R}(\boldsymbol{v}^{(i)}) \tag{9}

ここで、上付きの (i)(i) は反復の回数(下付きの ii の頂点の番号とは別の意味です)、α(i)\alpha^{(i)} はステップ幅です。直線探索でステップ幅を決めると計算の負担が大きいので、α\alpha を小さな値に固定することもできますが、それは時間刻み αΔt\alpha \Delta t の陽的オイラー法に当たります。論文は、準ニュートン法のセカント方程式の 2 点近似でステップ幅を決める Barzilai–Borwein 法(Barzilai と Borwein、1988)を、エンコードした空間で使い、ステップ幅を次のように近似します。

α(i)≈αBB(i):=⟨h(i)−h(i−1),R(h(i))−R(h(i−1))⟩Ω⟨R(h(i))−R(h(i−1)),R(h(i))−R(h(i−1))⟩Ω(16)\alpha^{(i)} \approx \alpha_{\mathrm{BB}}^{(i)} := \frac{\left\langle \boldsymbol{h}^{(i)} - \boldsymbol{h}^{(i-1)}, \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}) \right\rangle_{\Omega}}{\left\langle \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}), \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}) \right\rangle_{\Omega}} \tag{16}

ここで、h(i)\boldsymbol{h}^{(i)} は反復 ii 回目のエンコードした空間の状態(重要点 2 の hi\boldsymbol{h}_i は 1 つの頂点の特徴でしたが、ここではすべての頂点の特徴をまとめたもの)、R(h)\boldsymbol{R}(\boldsymbol{h}) はエンコードした空間での残差ベクトル、⟨f,g⟩Ω:=∑xi∈Ωf(xi)⋅g(xi)\langle \boldsymbol{f}, \boldsymbol{g} \rangle_{\Omega} := \sum_{\boldsymbol{x}_i \in \Omega} \boldsymbol{f}(\boldsymbol{x}_i) \cdot \boldsymbol{g}(\boldsymbol{x}_i) はメッシュ全体での内積です(この和の ii は頂点の番号です)。内積をメッシュ(グラフ)全体でとるので、αBB(i)\alpha_{\mathrm{BB}}^{(i)} の計算は大域的なプーリングに当たります。最終的に、ニューラル非線形ソルバーの、反復 ii 回目の状態から i+1i + 1 回目の状態への更新は、次のように表されます。

h(i+1)=DirichletLayer⁡(h(i)−αBB(i)[h(i)−h(0)−DNIsoGCN(h(i))Δt])(17)\boldsymbol{h}^{(i+1)} = \operatorname{DirichletLayer}\left( \boldsymbol{h}^{(i)} - \alpha_{\mathrm{BB}}^{(i)} \left[ \boldsymbol{h}^{(i)} - \boldsymbol{h}^{(0)} - \mathcal{D}_{\mathrm{NIsoGCN}}(\boldsymbol{h}^{(i)}) \Delta t \right] \right) \tag{17}

ここで、h(0)\boldsymbol{h}^{(0)} はエンコードした u(t,⋅)\boldsymbol{u}(t, \cdot)(式 (9) の初期値に当たる)、DNIsoGCN\mathcal{D}_{\mathrm{NIsoGCN}} は、NIsoGCN が与える微分演算子で D\mathcal{D} の構造を反映した、E(n) 同変な GNN です。論文は、次のように述べています。

  • このソルバーによって、処理部が局所的な情報と大域的な情報の両方を考慮することを期待しており、陽解法に当たる、単に GNN を積み重ねる方法より有利でありうると考えています。
  • ソルバーとニューラルネットワークの組合せは、NeuralODE(Chen ら、2018)などで既に提案されています。本研究の新規性は、空間の構造を持つ PDE を解く方法への拡張と、ソルバーへの大域的なプーリングの取り込みで、これによって大域的な相互作用を扱えます。これをニューラル非線形ソルバーと呼んでいます。
  • 式 (17) は、隠れた特徴に、境界条件を含むエンコードした PDE を満たさせます。物理(PDE)を損失ではなくモデルに埋め込むことが、physics-embedded neural networks という名前の由来です。
  • PINNs(Raissi ら、2019)は、出力が方程式をどれだけ満たすかを損失で見る方法です。論文は、PINNs は出力が空間の関数でなければならず、モデルの中に PDE の情報を持たないので、形状と境界条件が変わる場合に汎化するモデルを作るのには使えないと述べています。これに対して、PENN はモデルの中に PDE の情報を持ち、頂点の絶対的な位置を入力にしないので、高い汎化性能を持つとしています(数値実験の結果の図 3)。
  • 提案したすべての部品は E(n) 同変性と両立します。付録 A.3 で、論文は、αBB(i)\alpha_{\mathrm{BB}}^{(i)} は座標に依存しないスカラーなので同変であると述べています。

数値実験の結果

論文は、2 種類のデータセットで実験しています。NIsoGCN の正しさを確かめる勾配のデータセットと、モデルの速度と精度を示す非圧縮性流れのデータセットです。また、提案手法の有効性を確かめるため、部品を外したモデルとの比較(アブレーション)も行っています。実装は、元の IsoGCN のコードに基づいています。

勾配のデータセット

IsoGCN の論文(Horie ら、2021)と同じように、与えたスカラー場から勾配の場を予測して、NIsoGCN の表現力を確かめています。

  • データ:X、Y、Z の方向にそれぞれ 10〜20 個のセルを持つ直方体のメッシュをランダムに作り、次数 10 の多項式でランダムなスカラー場を作って、その勾配の場を解析的に計算しています。
  • モデル:元の IsoGCN と NIsoGCN を比べています。公平に比べるため、論文の新規性の一部である式 (15) の Mi\boldsymbol{M}_i の逆行列を除いて、両方のモデルの入力の情報を同じにしています(原論文の付録 B)。

テストのデータセットでの MSE の損失は、次のとおりです(原論文 Table 1。± は平均の標準誤差)。ここで、ϕ\phi は与えたスカラー場、g^Neumann\hat{g}_{\mathrm{Neumann}} の列は、ノイマン境界条件を課した境界だけで計算した損失です。

手法 ∇ϕ\nabla \phi の損失(×10−3\times 10^{-3}) g^Neumann\hat{g}_{\mathrm{Neumann}} の損失(×10−3\times 10^{-3})
元の IsoGCN 192.72 ± 1.69 1390.95 ± 7.93
NIsoGCN 6.70 ± 0.15 3.52 ± 0.02
勾配の場と誤差の比較
図 2 テストのデータの 1 つのサンプルの、勾配の場(上)と、予測した勾配と正解の差の大きさ(下)。メッシュの中央で切った断面です。左から、正解、元の IsoGCN、NIsoGCN です。出典:原論文 Fig. 2。
  • NIsoGCN は、特に境界の近くで、勾配の予測を改善しています(表と図 2)。論文は、これを、NIsoGCN がノイマン境界条件をうまく考慮できていることを示すものとしています。

非圧縮性流れのデータセット

論文は、複雑な形状の非圧縮性流れを学習させて、モデルの表現力を調べています。対応する非線形の微分作用素は、次のとおりです。

DNS(u):=−(u⋅∇)u+1Re∇⋅∇u−∇p(18)\mathcal{D}_{\mathrm{NS}}(\boldsymbol{u}) := -(\boldsymbol{u} \cdot \nabla) \boldsymbol{u} + \frac{1}{\mathrm{Re}} \nabla \cdot \nabla \boldsymbol{u} - \nabla p \tag{18}

ここで、DNS\mathcal{D}_{\mathrm{NS}} は非圧縮性 Navier–Stokes 方程式の微分作用素、u\boldsymbol{u} は流速の場、pp は圧力の場、Re\mathrm{Re} はレイノルズ数で、非圧縮の条件 ∇⋅u=0\nabla \cdot \boldsymbol{u} = 0 を課します。

  • データ:3 つのひな形の形状から設計パラメータを変えて、Z の方向に 1 つのセルを持つ擬似 2 次元の形状を作り、古典的なソルバーの OpenFOAM で、時間刻み Δt=10−3\Delta t = 10^{-3} で数値解析しています。初期条件はポテンシャル流れの解で、レイノルズ数は 10310^{3} 程度です。機械学習のモデルには、元の数値解析よりおよそ 4 倍大きいセルの粗いメッシュを使い、正解は補間で得ています。課題は、初期条件やメッシュの形状など、数値解析の前に得られる情報から、t=4.0t = 4.0 の流速と圧力の場を予測することです。学習用、検証用、テスト用のデータセットは、それぞれ 203、25、25 サンプルです。汎化性能を調べるため、テストのサンプルをランダムに回転、並進したデータセットも作っています。
  • PENN のモデル:非圧縮性 Navier–Stokes 方程式に対応する PENN のモデルです。フラクショナルステップ法を採り、圧力の場も、流速の場とともに PDE の解として求めます。各特徴を 4、8、16 次元のいずれかの空間にエンコードし、NIsoGCN とディリクレ層を含むニューラル非線形ソルバーを適用します。このソルバーの反復の中に、圧力のポアソン方程式を解く内側の反復があり、圧力は 5 回、流速は 4 回か 8 回反復します。反復の後、擬似逆のデコーダーでデコードして、流速と圧力の予測を得ます。
  • 比較の対象:境界条件を扱う方法も持つ、最先端の機械学習のモデル MP-PDE(Brandstetter ら、2022)です。著者のコードを、課題に合わせて最小限だけ変えて使っています。時間窓の大きさ(1 ステップが時間刻み Δt=0.1\Delta t = 0.1 に当たる)を 2、4、10、20 と変え、t=4.0t = 4.0 の状態を予測するときにモデルから見えるホップの数がほぼ同じになるように、GNN の 1 回の演算で考慮するホップの数を変えています。隠れた特徴の数は 32、64、128 を試しています。すべてのモデルは、1 台の GPU(NVIDIA A100 for NVLink 40GiB HBM2)で最大 24 時間学習しています。

MP-PDE と PENN の結果は、次のとおりです(原論文 Table 2。テストのデータセットでの MSE の損失で、± は平均の標準誤差)。「回転・並進」が「あり」の行は、ランダムに回転、並進したテストのデータセットでの評価です。u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}} と p^Dirichlet\hat{p}_{\mathrm{Dirichlet}} の列は、ディリクレ境界条件を課した境界だけで計算した、u\boldsymbol{u} と pp の損失です。MP-PDE は、時間窓の大きさが 20 のモデル(原論文の表の表記は TW = 20)の結果です。

手法 回転・並進 u\boldsymbol{u}(×10−4\times 10^{-4}) pp(×10−3\times 10^{-3}) u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}}(×10−4\times 10^{-4}) p^Dirichlet\hat{p}_{\mathrm{Dirichlet}}(×10−3\times 10^{-3})
MP-PDE(TW = 20) なし 1.30 ± 0.01 1.32 ± 0.01 0.45 ± 0.01 0.28 ± 0.02
MP-PDE(TW = 20) あり 1953.62 ± 7.62 281.86 ± 0.78 924.73 ± 6.14 202.97 ± 3.81
PENN なし 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
PENN あり 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
流速と圧力の場の比較
図 3 正解、MP-PDE(TW = 20)、PENN の流速の場(上の 2 行)と圧力の場(下の 2 行)の比較。1 行目と 3 行目はランダムな回転、並進なし、2 行目と 4 行目はありです。原論文の図の説明は、PENN の予測はモデルの E(n) 同変性によって回転と並進の下で一貫しており、MP-PDE の予測性能は変換の下で低下する、としています。出典:原論文 Fig. 3。
  • 元のテストのデータセットでは、両方のモデルの予測性能はほぼ同じ水準です(論文の評価。表では、u\boldsymbol{u} の損失は MP-PDE が小さく、pp の損失は PENN が小さくなっています)。論文は、MP-PDE の設定をできるだけ既定のままにし、課題に特有の調整をしていないので、これは MP-PDE の高い表現力を示す結果であるとしています。
  • 回転、並進したデータセットでは、MP-PDE の予測性能は大きく低下します。一方、PENN は数値誤差の範囲で同じ損失を示し、論文は、提案した部品が E(n) 同変性と両立することを確かめたとしています。
  • PENN は、ディリクレ境界の上で誤差がありません(表の 0.00)。論文は、これを、ディリクレ境界条件の扱いが厳密であることを示すものとしています。

図 4 は、OpenFOAM、MP-PDE、PENN の、速度と精度のトレードオフです。OpenFOAM は、メッシュのセルの大きさ、時間刻み、線形ソルバーの設定を変えて、計算の速さと精度を変えています。計算は、すべて Intel Xeon CPU E5-2695 v2 @ 2.40 GHz の 1 コアで行っています。

計算時間と合計の MSE の損失の比較
図 4 テストのデータセット(回転、並進の有無の両方)での、OpenFOAM、MP-PDE、PENN の計算時間と合計の MSE の損失(u\boldsymbol{u} と pp)の比較。誤差棒は平均の標準誤差です。図の値は、原論文の付録の Table 5〜7 にあります。出典:原論文 Fig. 4。
  • 論文は、公平な比較の条件で、提案モデルが、試したすべての手法の中で、速度と精度のトレードオフで最も良い性能を達成したと述べています。
  • 最も精度の高い PENN(隠れた特徴の数 16、ソルバーの反復 8 回)の合計の MSE は 1.61×10−31.61 \times 10^{-3}、計算時間は 5.33 秒です(原論文の付録の Table 5)。
  • 付録で、論文は、PENN が MP-PDE よりずっと少ないパラメータ(PENN は 596〜8,432 個、MP-PDE は 47,924〜709,316 個)で優れた性能を示し、これは同じ重みを繰り返し使う、効率的なパラメータの共有によると述べています(原論文の付録 C.6、Table 5、6)。

提案した部品を外したモデルとの比較(アブレーション)も行っています。比べたモデルは次の (A)〜(G) です(記号は原論文の付録 C.7 と Table 8 のもので、説明は付録 C.7 によります)。

  • (A) エンコードした境界なし:非線形ソルバーの反復の中で特徴をデコードし、元の物理空間でディリクレ境界条件を課したモデル
  • (B) ニューラル非線形ソルバーの中の境界条件なし:反復の中のディリクレ層を外し、(擬似逆でない)デコーダーの後にディリクレ層を置いたモデル
  • (C) ニューラル非線形ソルバーなし:非線形ソルバーを外し、陽的な時間発展にしたモデル
  • (D) 境界条件の入力なし:入力の特徴から境界条件を外したモデル
  • (E) ディリクレ層なし:ディリクレ層を外し、学習で境界条件を満たすようにしたモデル
  • (F) 擬似逆のデコーダーなし:擬似逆のデコーダーの代わりに、単純な MLP をデコーダーにしたモデル
  • (G) 擬似逆のデコーダーなし、デコードの後にディリクレ層:(F) のデコードの後に、ディリクレ層を置いたモデル

結果は次のとおりです(原論文 Table 3。テストのデータセットでの MSE の損失で、± は平均の標準誤差)。「発散」は、陰的なソルバーが収束せず、損失が極端な値(∼1014\sim 10^{14})になったことを表します。

手法 u\boldsymbol{u}(×10−4\times 10^{-4}) pp(×10−3\times 10^{-3}) u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}}(×10−4\times 10^{-4}) p^Dirichlet\hat{p}_{\mathrm{Dirichlet}}(×10−3\times 10^{-3})
(A) 発散 発散 発散 発散
(B) 65.10 ± 0.38 21.70 ± 0.09 0.00 ± 0.00 0.00 ± 0.00
(C) 31.03 ± 0.19 9.81 ± 0.04 0.00 ± 0.00 0.00 ± 0.00
(D) 20.08 ± 0.21 3.61 ± 0.02 59.60 ± 0.89 1.43 ± 0.05
(E) 8.22 ± 0.07 1.41 ± 0.01 18.20 ± 0.28 0.38 ± 0.01
(F) 8.91 ± 0.06 2.36 ± 0.02 1.97 ± 0.06 0.00 ± 0.00
(G) 6.65 ± 0.05 1.71 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
PENN 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
  • 論文は、提案した部品(境界エンコーダー、ディリクレ層、擬似逆のデコーダー、ニューラル非線形ソルバー)が、いずれもモデルを大きく改善すると述べています。
  • 論文は、エンコードした空間でのニューラル非線形ソルバーが性能に最も大きく影響し、ディリクレ層は、ディリクレ境界条件を厳密に満たす、信頼できるモデルを保証したとしています。付録 C.7 で、論文は、(A) との比較から、エンコードした空間での非線形ソルバーの反復が機械学習に不可欠であるとしています。
  • (G) もディリクレ境界条件を満たしますが、PENN の方が精度が高くなっています。論文は、擬似逆のデコーダーが、ディリクレ境界条件を満たすことに加えて、出力の空間的な連続性を助けるためかもしれないと考えています(原論文の付録 C.7)。

今後の展開

  • 論文は、PENN の性質は望ましい一方で、効果的な PENN のモデルを作るには、対象の PDE の具体的な形を知っている必要があるので、適用できる範囲が限られると述べています。たとえば、支配方程式の明示的な形が得られない逆問題には、提案モデルの能力を活かせません。このため、PINNs と PENN を組み合わせることが、研究コミュニティの次の方向になりうるとしています。
  • 付録 C.6 で、論文は、MP-PDE の性能が時間窓を大きくするほど良くなることから、MP-PDE のテンポラルバンドリングと pushforward trick を PENN に取り込み、さらに長い時間の後の状態を予測できるようにすることを、今後の方向の一つとしています。
Graphical abstract
Graphical abstract

Overview

Graph neural networks (GNNs) are a promising approach to learning and predicting physical phenomena described in boundary value problems, such as partial differential equations (PDEs) with boundary conditions. However, existing models inadequately treat the boundary conditions that are essential for the reliable prediction of such problems. In addition, because of the locally connected nature of GNNs, it is difficult to accurately predict the state after a long time, where the interaction between vertices tends to be global.

This paper proposes physics-embedded neural networks (PENNs), which consider boundary conditions and predict the state after a long time using an implicit method. PENN is built on an E(n)-equivariant GNN and shows high generalization performance on various shapes. As components to satisfy mixed boundary conditions (Dirichlet and Neumann boundary conditions), the paper constructs the boundary encoder, the Dirichlet layer, the pseudoinverse decoder, and NeumannIsoGCN (NIsoGCN), and it proposes neural nonlinear solvers as global connections to stably predict the state after a long time. In experiments on flows in complex shapes, the paper reports that PENN fulfills Dirichlet boundary conditions with no error and outperforms a well-optimized classical solver and a state-of-the-art machine learning model in the speed–accuracy tradeoff. The paper states that PENN can be a useful standard for realizing reliable, fast, and accurate GNN-based PDE solvers. The code is available at https://github.com/yellowshippo/penn-neurips2022.

Key points

1. PDEs with mixed boundary conditions and the architecture of PENN

The paper considers temporal PDEs of the following general form.

∂u∂t(t,x)=D(u)(t,x)(t,x)∈(0,T)×Ω(1)\frac{\partial \boldsymbol{u}}{\partial t}(t, \boldsymbol{x}) = \mathcal{D}(\boldsymbol{u})(t, \boldsymbol{x}) \qquad (t, \boldsymbol{x}) \in (0, T) \times \Omega \tag{1} u(t,x)=u^(t,x)(t,x)∈(0,T)×∂ΩDirichlet(3)\boldsymbol{u}(t, \boldsymbol{x}) = \hat{\boldsymbol{u}}(t, \boldsymbol{x}) \qquad (t, \boldsymbol{x}) \in (0, T) \times \partial\Omega_{\mathrm{Dirichlet}} \tag{3} f^(∇u(t,x),n(x))=0(t,x)∈(0,T)×∂ΩNeumann(4)\hat{\boldsymbol{f}}(\nabla \boldsymbol{u}(t, \boldsymbol{x}), \boldsymbol{n}(\boldsymbol{x})) = \boldsymbol{0} \qquad (t, \boldsymbol{x}) \in (0, T) \times \partial\Omega_{\mathrm{Neumann}} \tag{4}

Here, tt is time, x\boldsymbol{x} is the position, TT is the end of the analyzed time, u\boldsymbol{u} is the unknown field, D\mathcal{D} is a known differential operator (which can be nonlinear and contains spatial differential operators), Ω\Omega is the analysis domain, ∂ΩDirichlet\partial\Omega_{\mathrm{Dirichlet}} and ∂ΩNeumann\partial\Omega_{\mathrm{Neumann}} are the boundaries where Dirichlet and Neumann boundary conditions are imposed, and n(x)\boldsymbol{n}(\boldsymbol{x}) is the normal vector at a point x\boldsymbol{x} on the boundary. u^\hat{\boldsymbol{u}} and f^\hat{\boldsymbol{f}} are known functions (the paper uses ^ on a symbol to denote a known function). Equation (3) is the Dirichlet boundary condition, which sets the value on the boundary as a constraint. Equation (4) corresponds to the Neumann boundary condition, which sets the derivative in the normal direction on the boundary rather than the value. The two together are called mixed boundary conditions. The problem to be solved consists of these equations and an initial condition (Eq. (2) of the original paper).

The paper states that existing approaches to solving PDEs with machine learning have the following two points to improve.

  • An efficient and provable way to respect Dirichlet and Neumann boundary conditions (mixed boundary conditions) is needed. Rigorous fulfillment of Dirichlet boundary conditions is indispensable, because they are hard constraints and different Dirichlet conditions correspond to different problems that users would like to solve. With existing methods that feed boundary conditions to models as inputs, one could expect the model to learn to satisfy the boundary conditions approximately, but there is no guarantee to fulfill hard constraints such as Dirichlet conditions.
  • The treatment of global interaction needs to be reinforced to predict the state after a long time, where interactions tend to be global. GNNs have excellent generalization properties because of their locally connected nature, but they may miss global interaction.

PENN adopts the encode-process-decode architecture. It encodes the input features, including information on boundary conditions, iterates a GNN-based nonlinear solver reflecting the boundary conditions in the encoded space, and then decodes carefully to satisfy the boundary conditions in the output space (Figure 1). PENN is built on IsoGCN (Horie et al., 2021), a lightweight E(n)-equivariant GNN, to reflect physical symmetry and realize fast prediction.

Overview of PENN
Figure 1. Overview of the proposed method, PENN. The input features are encoded with the encoder and the boundary conditions with the boundary encoder, and a neural nonlinear solver consisting of an E(n)-equivariant GNN (the Dirichlet layer and NeumannIsoGCN) is iterated in the encoded space. The encoded boundary conditions are applied at each iteration, and after the iterations the pseudoinverse decoder decodes the features to satisfy the Dirichlet boundary conditions. Source: Fig. 1 of the original paper.

2. Rigorous fulfillment of Dirichlet boundary conditions: the boundary encoder, the Dirichlet layer, and the pseudoinverse decoder

The paper states that the expressive power of neural networks comes from encoding in a higher-dimensional space, where the corresponding boundary conditions are not trivial. If the layers of the processor, which resides in the encoded space, have no treatment of boundary conditions, the trajectory of the solution can be far from the one with the boundary conditions; the paper therefore regards the treatment of boundary conditions in the encoded space as essential for reliable neural PDE solvers that fulfill boundary conditions.

To place the variables and the boundary conditions in the same encoded space, the paper uses the same encoder for the variables and the corresponding Dirichlet boundary conditions. This is called the boundary encoder.

hi=fencode(ui) in Ω,h^i=fencode(u^i) on ∂ΩDirichlet(11)\boldsymbol{h}_i = \boldsymbol{f}_{\mathrm{encode}}(\boldsymbol{u}_i) \text{ in } \Omega, \quad \hat{\boldsymbol{h}}_i = \boldsymbol{f}_{\mathrm{encode}}(\hat{\boldsymbol{u}}_i) \text{ on } \partial\Omega_{\mathrm{Dirichlet}} \tag{11}

Here, fencode\boldsymbol{f}_{\mathrm{encode}} is the encoder, ui\boldsymbol{u}_i is the value of u\boldsymbol{u} at the ii-th vertex of the mesh (at position xi\boldsymbol{x}_i), hi\boldsymbol{h}_i is its encoded feature, u^i\hat{\boldsymbol{u}}_i is the value of the Dirichlet boundary condition at the ii-th vertex, and h^i\hat{\boldsymbol{h}}_i is its encoded value. The paper treats the mesh as a graph. In the encoded space, the Dirichlet boundary conditions can easily be applied with the following Dirichlet layer.

DirichletLayer⁡(hi)={hi,xi∉∂ΩDirichleth^i,xi∈∂ΩDirichlet(12)\operatorname{DirichletLayer}(\boldsymbol{h}_i) = \begin{cases} \boldsymbol{h}_i, & \boldsymbol{x}_i \notin \partial\Omega_{\mathrm{Dirichlet}} \\ \hat{\boldsymbol{h}}_i, & \boldsymbol{x}_i \in \partial\Omega_{\mathrm{Dirichlet}} \end{cases} \tag{12}

This layer replaces the features of the vertices on the Dirichlet boundary with the values of the encoded boundary conditions. The paper states that this process is necessary to return to a state respecting the boundary conditions after operations in the processor that might disrespect them. After the processor layers, the paper decodes the hidden features using functions satisfying the following condition.

fdecode∘fencode(u^i)=u^i on ∂ΩDirichlet(13)\boldsymbol{f}_{\mathrm{decode}} \circ \boldsymbol{f}_{\mathrm{encode}}(\hat{\boldsymbol{u}}_i) = \hat{\boldsymbol{u}}_i \text{ on } \partial\Omega_{\mathrm{Dirichlet}} \tag{13}

Here, fdecode\boldsymbol{f}_{\mathrm{decode}} is the decoder. This condition makes the encoded boundary conditions correspond to those in the original physical space. Demanding that Eq. (13) hold for arbitrary values of the boundary condition, fdecode∘fencode\boldsymbol{f}_{\mathrm{decode}} \circ \boldsymbol{f}_{\mathrm{encode}} becomes the identity map, resulting in fdecode=fencode+\boldsymbol{f}_{\mathrm{decode}} = \boldsymbol{f}_{\mathrm{encode}}^{+}. The paper calls this the pseudoinverse decoder. Because encoding in a higher-dimensional space may not be invertible, fencode+\boldsymbol{f}_{\mathrm{encode}}^{+} is constructed using pseudoinverse matrices. For example, the paper shows in Appendix A.1 that, for a multilayer perceptron (MLP) with one hidden layer, it can be constructed from the pseudoinverse matrices of the weight matrices and the inverse functions of the activation functions (LeakyReLU).

3. NeumannIsoGCN, which incorporates Neumann boundary conditions

IsoGCN, on which PENN is based, is an E(n)-equivariant GNN (equivariant to translation, rotation, and reflection), and its layer that converts a scalar field into a vector field corresponds to the gradient operator. The treatment of boundary conditions was out of the scope of IsoGCN. The gradient operator of IsoGCN originates from the least squares moving particle semi-implicit (LSMPS) method, which solves PDEs using particles. The paper modifies the wall boundary model proposed for treating Neumann boundary conditions in the LSMPS method (Matsunaga et al., 2020) to adapt it to the situation where the vertices are on the Neumann boundary, which differs from particle simulations, and constructs the following NeumannIsoGCN (NIsoGCN).

NIsoGCN0→1(ψ):=Mi−1[∑j∈Niψj−ψi∥xj−xi∥xj−xi∥xj−xi∥+winig^i]W(14)\mathrm{NIsoGCN}_{0 \to 1}(\psi) := \boldsymbol{M}_i^{-1} \left[ \sum_{j \in \mathcal{N}_i} \frac{\psi_j - \psi_i}{\lVert \boldsymbol{x}_j - \boldsymbol{x}_i \rVert} \frac{\boldsymbol{x}_j - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_j - \boldsymbol{x}_i \rVert} + w_i \boldsymbol{n}_i \hat{g}_i \right] \boldsymbol{W} \tag{14} Mi:=∑l∈Nixl−xi∥xl−xi∥⊗xl−xi∥xl−xi∥+wini⊗ni(15)\boldsymbol{M}_i := \sum_{l \in \mathcal{N}_i} \frac{\boldsymbol{x}_l - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_l - \boldsymbol{x}_i \rVert} \otimes \frac{\boldsymbol{x}_l - \boldsymbol{x}_i}{\lVert \boldsymbol{x}_l - \boldsymbol{x}_i \rVert} + w_i \boldsymbol{n}_i \otimes \boldsymbol{n}_i \tag{15}

Here, Eq. (14) is the output of the layer at the ii-th vertex, and the subscript 0→10 \to 1 indicates a layer that takes a scalar field (a rank-0 tensor) as input and outputs a vector field (a rank-1 tensor). ψ\psi is the input scalar field (ψi\psi_i is its value at the ii-th vertex), Ni\mathcal{N}_i is the set of vertices neighboring the ii-th vertex (jj and ll are the indices of vertices in it), Mi\boldsymbol{M}_i is the matrix defined by Eq. (15), ∥⋅∥\lVert \cdot \rVert is the norm, ⊗\otimes is the tensor product, ni\boldsymbol{n}_i is the normal vector at the ii-th vertex, g^i\hat{g}_i is the value of the Neumann boundary condition at xi\boldsymbol{x}_i, W\boldsymbol{W} is a trainable matrix, and wi>0w_i > 0 is an untrainable parameter that controls the strength of the Neumann constraint. The paper further states the following.

  • As wi→∞w_i \to \infty, the model strictly satisfies the given Neumann condition in the direction ni\boldsymbol{n}_i, while the directional derivatives in the direction of (xj−xi)(\boldsymbol{x}_j - \boldsymbol{x}_i) tend to be relatively neglected. The paper therefore keeps wiw_i moderate and sets wi=10.0w_i = 10.0, assuming that around ten vertices may virtually exist "outside" the boundary on a flat surface in a three-dimensional space.
  • Letting ni=0\boldsymbol{n}_i = \boldsymbol{0} at the vertices that are not on the Neumann boundary makes NIsoGCN identical to the original IsoGCN. In other words, NIsoGCN is a straightforward generalization of the original IsoGCN.
  • Similarly to the original IsoGCN, it can be generalized to vectors and higher-rank tensors. Therefore, NIsoGCN can express any spatial differential operator constituting D\mathcal{D} in PDEs (Appendix A.2 of the paper shows the correspondence to the gradient, divergence, Laplacian, Jacobian, and Hessian).

4. Neural nonlinear solver: solving the implicit method as optimization with global interaction

The simplest method to discretize time is the explicit Euler method, which updates u(t,xi)\boldsymbol{u}(t, \boldsymbol{x}_i) with a small increment D(u)(t,xi)Δt\mathcal{D}(\boldsymbol{u})(t, \boldsymbol{x}_i) \Delta t (Eq. (5) of the original paper). The implicit Euler method, in contrast, solves the following equation.

u(t+Δt,xi)=u(t,xi)+D(u)(t+Δt,xi)Δt(6)\boldsymbol{u}(t + \Delta t, \boldsymbol{x}_i) = \boldsymbol{u}(t, \boldsymbol{x}_i) + \mathcal{D}(\boldsymbol{u})(t + \Delta t, \boldsymbol{x}_i) \Delta t \tag{6}

Here, Δt\Delta t is the time step size. Eq. (6) is solved, rather than used to simply update variables, so that the original PDE is satisfied numerically, and it can be viewed as the following nonlinear optimization problem.

R(v):=v−u(t,⋅)−D(v)Δt(7)\boldsymbol{R}(\boldsymbol{v}) := \boldsymbol{v} - \boldsymbol{u}(t, \cdot) - \mathcal{D}(\boldsymbol{v}) \Delta t \tag{7}

Here, R(v)\boldsymbol{R}(\boldsymbol{v}) is the residual vector of the discretized PDE and v\boldsymbol{v} is the unknown variable. The v\boldsymbol{v} that gives R(v)(xi)=0\boldsymbol{R}(\boldsymbol{v})(\boldsymbol{x}_i) = \boldsymbol{0} at all vertices (the solution of Eq. (8) of the original paper) corresponds to u(t+Δt,⋅)\boldsymbol{u}(t + \Delta t, \cdot). A simple way to solve this optimization problem is the following gradient descent.

v(0):=u(t,⋅),v(i+1):=v(i)−α(i)R(v(i))(9)\boldsymbol{v}^{(0)} := \boldsymbol{u}(t, \cdot), \quad \boldsymbol{v}^{(i+1)} := \boldsymbol{v}^{(i)} - \alpha^{(i)} \boldsymbol{R}(\boldsymbol{v}^{(i)}) \tag{9}

Here, the superscript (i)(i) is the iteration count (a different meaning from the subscript ii for the vertex index), and α(i)\alpha^{(i)} is the step size. Because determining the step size by line search has a high computational cost, α\alpha can be fixed to a small value, but this corresponds to the explicit Euler method with the time step size αΔt\alpha \Delta t. The paper adopts, in the encoded space, the Barzilai–Borwein method (Barzilai and Borwein, 1988), which determines the step size using a two-point approximation to the secant equation underlying quasi-Newton methods, and approximates the step size as follows.

α(i)≈αBB(i):=⟨h(i)−h(i−1),R(h(i))−R(h(i−1))⟩Ω⟨R(h(i))−R(h(i−1)),R(h(i))−R(h(i−1))⟩Ω(16)\alpha^{(i)} \approx \alpha_{\mathrm{BB}}^{(i)} := \frac{\left\langle \boldsymbol{h}^{(i)} - \boldsymbol{h}^{(i-1)}, \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}) \right\rangle_{\Omega}}{\left\langle \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}), \boldsymbol{R}(\boldsymbol{h}^{(i)}) - \boldsymbol{R}(\boldsymbol{h}^{(i-1)}) \right\rangle_{\Omega}} \tag{16}

Here, h(i)\boldsymbol{h}^{(i)} is the state in the encoded space at the ii-th iteration (whereas hi\boldsymbol{h}_i in Key point 2 is the feature of one vertex, here it collects the features of all vertices), R(h)\boldsymbol{R}(\boldsymbol{h}) is the residual vector in the encoded space, and ⟨f,g⟩Ω:=∑xi∈Ωf(xi)⋅g(xi)\langle \boldsymbol{f}, \boldsymbol{g} \rangle_{\Omega} := \sum_{\boldsymbol{x}_i \in \Omega} \boldsymbol{f}(\boldsymbol{x}_i) \cdot \boldsymbol{g}(\boldsymbol{x}_i) is the inner product over the mesh (the ii in this sum is the vertex index). Because the inner product is taken over the whole mesh (graph), computing αBB(i)\alpha_{\mathrm{BB}}^{(i)} corresponds to global pooling. Finally, the update from the state at the ii-th iteration to the (i+1)(i + 1)-th in the neural nonlinear solver is expressed as follows.

h(i+1)=DirichletLayer⁡(h(i)−αBB(i)[h(i)−h(0)−DNIsoGCN(h(i))Δt])(17)\boldsymbol{h}^{(i+1)} = \operatorname{DirichletLayer}\left( \boldsymbol{h}^{(i)} - \alpha_{\mathrm{BB}}^{(i)} \left[ \boldsymbol{h}^{(i)} - \boldsymbol{h}^{(0)} - \mathcal{D}_{\mathrm{NIsoGCN}}(\boldsymbol{h}^{(i)}) \Delta t \right] \right) \tag{17}

Here, h(0)\boldsymbol{h}^{(0)} is the encoded u(t,⋅)\boldsymbol{u}(t, \cdot) (corresponding to the initial value in Eq. (9)), and DNIsoGCN\mathcal{D}_{\mathrm{NIsoGCN}} is an E(n)-equivariant GNN reflecting the structure of D\mathcal{D} using the differential operators provided by NIsoGCN. The paper states the following.

  • With this solver, the paper expects the processor to consider both local and global information, which may have an advantage over simply stacking GNNs, which corresponds to the explicit method.
  • Combinations of solvers and neural networks have already been suggested, for example, in NeuralODE (Chen et al., 2018). The novelty of this study is the extension of existing methods to solving PDEs with spatial structure and the incorporation of global pooling into the solver, which enables the model to capture global interaction. This is called the neural nonlinear solver.
  • Eq. (17) enforces the hidden features to satisfy the encoded PDE, including the boundary conditions. Embedding physics (PDEs) in the model rather than in the loss is the origin of the name physics-embedded neural networks.
  • PINNs (Raissi et al., 2019) add a loss that monitors how much the output satisfies the equations. The paper states that, because the outputs of PINNs must be functions of space and PINNs lack PDE information inside the model, they are not applicable to building models that generalize over variations in shape and boundary conditions. In contrast, PENN contains PDE information inside the model and does not take the absolute positions of vertices as inputs, resulting in high generalizability (Figure 3 in the numerical results).
  • All the proposed components are compatible with E(n)-equivariance. In Appendix A.3, the paper states that αBB(i)\alpha_{\mathrm{BB}}^{(i)} is equivariant because it is a scalar that does not depend on coordinates.

Numerical results

The paper performs experiments on two types of datasets: the gradient dataset to verify the correctness of NIsoGCN, and the incompressible flow dataset to demonstrate the speed and accuracy of the model. To corroborate the effectiveness of the proposed method, it also compares models without the proposed components (an ablation study). The implementation is based on the original IsoGCN code.

Gradient dataset

As done in the IsoGCN paper (Horie et al., 2021), the expressive power of NIsoGCN is verified by predicting the gradient field from a given scalar field.

  • Data: cuboid-shaped meshes with 10 to 20 cells in each of the X, Y, and Z directions were generated randomly, random scalar fields were generated over these meshes using polynomials of degree 10, and their gradient fields were computed analytically.
  • Models: the original IsoGCN and NIsoGCN are compared. For a fair comparison, the input information of both models is the same, except for the inverse of Mi\boldsymbol{M}_i of Eq. (15), which is part of the novelty of the paper (Appendix B of the original paper).

The MSE losses on the test dataset are as follows (Table 1 of the original paper; ± is the standard error of the mean). Here, ϕ\phi is the given scalar field, and the g^Neumann\hat{g}_{\mathrm{Neumann}} column is the loss computed only on the boundary where the Neumann condition is set.

Method Loss of ∇ϕ\nabla \phi (×10−3\times 10^{-3}) Loss of g^Neumann\hat{g}_{\mathrm{Neumann}} (×10−3\times 10^{-3})
Original IsoGCN 192.72 ± 1.69 1390.95 ± 7.93
NIsoGCN 6.70 ± 0.15 3.52 ± 0.02
Comparison of the gradient field and the error
Figure 2. Gradient field (top) and the magnitude of the error between the predicted gradient and the ground truth (bottom) for a test data sample, sliced at the center of the mesh. From left to right: the ground truth, the original IsoGCN, and NIsoGCN. Source: Fig. 2 of the original paper.
  • NIsoGCN improves the gradient prediction, especially near the boundary (the table and Figure 2). The paper takes this as showing that NIsoGCN successfully considers Neumann boundary conditions.

Incompressible flow dataset

The paper tests the expressive power of the model by learning incompressible flow in complex shapes. The corresponding nonlinear differential operator is as follows.

DNS(u):=−(u⋅∇)u+1Re∇⋅∇u−∇p(18)\mathcal{D}_{\mathrm{NS}}(\boldsymbol{u}) := -(\boldsymbol{u} \cdot \nabla) \boldsymbol{u} + \frac{1}{\mathrm{Re}} \nabla \cdot \nabla \boldsymbol{u} - \nabla p \tag{18}

Here, DNS\mathcal{D}_{\mathrm{NS}} is the differential operator of the incompressible Navier–Stokes equations, u\boldsymbol{u} is the flow velocity field, pp is the pressure field, and Re\mathrm{Re} is the Reynolds number, with the incompressible condition ∇⋅u=0\nabla \cdot \boldsymbol{u} = 0.

  • Data: pseudo-2D shapes with one cell in the Z direction were generated by changing design parameters starting from three template shapes, and numerical analysis was performed with the classical solver OpenFOAM with the time step size Δt=10−3\Delta t = 10^{-3}. The initial conditions are the solutions of potential flow, and the Reynolds number is around 10310^{3}. For the machine learning models, coarse meshes with cells roughly four times larger than those of the original numerical analysis were used, and the ground truth was obtained by interpolation. The task is to predict the flow velocity and pressure fields at t=4.0t = 4.0 from information available before the numerical analysis, such as the initial conditions and the geometries of the meshes. The training, validation, and test datasets consist of 203, 25, and 25 samples, respectively. To monitor the generalization ability, a dataset in which the test samples are randomly rotated and translated was also generated.
  • PENN model: a PENN model corresponding to the incompressible Navier–Stokes equations. It adopts the fractional step method, in which the pressure field is also obtained as a PDE solution along with the velocity field. Each feature is encoded in a 4-, 8-, or 16-dimensional space, and a neural nonlinear solver containing NIsoGCNs and Dirichlet layers is applied. Inside the loop of this solver, there is a subloop that solves the Poisson equation for pressure; the solver is looped five times for pressure and four or eight times for velocity. After the loops, the features are decoded with the pseudoinverse decoders to obtain the predictions of velocity and pressure.
  • Comparison: MP-PDE (Brandstetter et al., 2022), a state-of-the-art machine learning model that also provides a way to deal with boundary conditions. The authors' code was used with minimum modification to adapt to the task. The time window size (one step corresponds to the time step size Δt=0.1\Delta t = 0.1) was varied as 2, 4, 10, and 20, and the number of hops considered in one operation of the GNN was changed so that the number of hops visible from the model when predicting the state at t=4.0t = 4.0 is almost the same. The numbers of hidden features 32, 64, and 128 were tested. All models were trained for up to 24 hours using one GPU (NVIDIA A100 for NVLink 40GiB HBM2).

The results of MP-PDE and PENN are as follows (Table 2 of the original paper; MSE losses on the test dataset, where ± is the standard error of the mean). The rows with "Yes" in the "Trans." column (rotation and translation) are evaluated on the randomly rotated and translated test dataset. The u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}} and p^Dirichlet\hat{p}_{\mathrm{Dirichlet}} columns are the losses of u\boldsymbol{u} and pp computed only on the boundary where the Dirichlet condition is set. MP-PDE is the model with a time window size of 20 (written as TW = 20 in the table of the original paper).

Method Trans. u\boldsymbol{u} (×10−4\times 10^{-4}) pp (×10−3\times 10^{-3}) u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}} (×10−4\times 10^{-4}) p^Dirichlet\hat{p}_{\mathrm{Dirichlet}} (×10−3\times 10^{-3})
MP-PDE (TW = 20) No 1.30 ± 0.01 1.32 ± 0.01 0.45 ± 0.01 0.28 ± 0.02
MP-PDE (TW = 20) Yes 1953.62 ± 7.62 281.86 ± 0.78 924.73 ± 6.14 202.97 ± 3.81
PENN No 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
PENN Yes 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
Comparison of the velocity and pressure fields
Figure 3. Comparison of the velocity field (top two rows) and the pressure field (bottom two rows) among the ground truth, MP-PDE (TW = 20), and PENN. The first and third rows are without random rotation and translation, and the second and fourth rows are with them. The original caption states that the PENN prediction is consistent under rotation and translation owing to the E(n)-equivariance of the model, while the predictive performance of MP-PDE degrades under the transformations. Source: Fig. 3 of the original paper.
  • On the original test dataset, the predictive performances of both models are at almost the same level (the paper's evaluation; in the table, the loss of u\boldsymbol{u} is smaller for MP-PDE and the loss of pp is smaller for PENN). The paper states that this result shows the great expressive power of MP-PDE, because most of its settings were kept at default as much as possible and no task-specific tuning was applied.
  • On the rotated and translated dataset, the predictive performance of MP-PDE significantly degrades. In contrast, PENN shows the same loss up to the numerical error, which the paper states confirms that the proposed components are compatible with E(n)-equivariance.
  • PENN exhibits no error on the Dirichlet boundaries (0.00 in the table). The paper takes this as showing that its treatment of Dirichlet boundary conditions is rigorous.

Figure 4 shows the speed–accuracy tradeoff of OpenFOAM, MP-PDE, and PENN. For OpenFOAM, the mesh cell size, the time step size, and the linear solver settings were varied to obtain different computation speeds and accuracies. All computation was done using one core of Intel Xeon CPU E5-2695 v2 @ 2.40 GHz.

Comparison of computation time and total MSE loss
Figure 4. Comparison of computation time and total MSE loss (u\boldsymbol{u} and pp) on the test dataset (with and without rotation and translation) among OpenFOAM, MP-PDE, and PENN. Error bars represent the standard error of the mean. The values in the figure are given in Tables 5 to 7 in the appendix of the original paper. Source: Fig. 4 of the original paper.
  • The paper states that the proposed model achieved the best performance in the speed–accuracy tradeoff among all the tested methods under fair comparison conditions.
  • The most accurate PENN (16 hidden features, 8 solver iterations) has a total MSE of 1.61×10−31.61 \times 10^{-3} with a computation time of 5.33 s (Table 5 in the appendix of the original paper).
  • In the appendix, the paper states that PENN shows excellent performance with far fewer parameters than MP-PDE (596 to 8,432 for PENN and 47,924 to 709,316 for MP-PDE), which is achieved through efficient parameter sharing in which the same weights are used repeatedly (Appendix C.6 and Tables 5 and 6 of the original paper).

The paper also compares models without the proposed components (an ablation study). The compared models are the following (A) to (G) (the labels are those of Appendix C.7 and Table 8 of the original paper, and the descriptions follow Appendix C.7).

  • (A) Without encoded boundary: a model that decodes the features in the loop of the nonlinear solver to apply the Dirichlet boundary conditions in the original physical space
  • (B) Without boundary condition in the neural nonlinear solver: a model in which the Dirichlet layer in the loop is removed and a Dirichlet layer is added after the (non-pseudoinverse) decoder
  • (C) Without neural nonlinear solver: a model in which the nonlinear solver is removed and explicit time stepping is used instead
  • (D) Without boundary condition input: a model in which the boundary conditions are removed from the input features
  • (E) Without Dirichlet layer: a model in which the Dirichlet layer is removed and the model learns to satisfy the boundary conditions during training
  • (F) Without pseudoinverse decoder: a model in which simple MLPs are used as decoders instead of the pseudoinverse decoder
  • (G) Without pseudoinverse decoder, with Dirichlet layer after decoding: a model in which a Dirichlet layer is added after the decoding of (F)

The results are as follows (Table 3 of the original paper; MSE losses on the test dataset, where ± is the standard error of the mean). "Divergent" means that the implicit solver does not converge and the loss gets an extreme value (∼1014\sim 10^{14}).

Method u\boldsymbol{u} (×10−4\times 10^{-4}) pp (×10−3\times 10^{-3}) u^Dirichlet\hat{\boldsymbol{u}}_{\mathrm{Dirichlet}} (×10−4\times 10^{-4}) p^Dirichlet\hat{p}_{\mathrm{Dirichlet}} (×10−3\times 10^{-3})
(A) Divergent Divergent Divergent Divergent
(B) 65.10 ± 0.38 21.70 ± 0.09 0.00 ± 0.00 0.00 ± 0.00
(C) 31.03 ± 0.19 9.81 ± 0.04 0.00 ± 0.00 0.00 ± 0.00
(D) 20.08 ± 0.21 3.61 ± 0.02 59.60 ± 0.89 1.43 ± 0.05
(E) 8.22 ± 0.07 1.41 ± 0.01 18.20 ± 0.28 0.38 ± 0.01
(F) 8.91 ± 0.06 2.36 ± 0.02 1.97 ± 0.06 0.00 ± 0.00
(G) 6.65 ± 0.05 1.71 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
PENN 4.36 ± 0.03 1.17 ± 0.01 0.00 ± 0.00 0.00 ± 0.00
  • The paper states that all the proposed components (the boundary encoder, the Dirichlet layer, the pseudoinverse decoder, and the neural nonlinear solver) significantly improve the models.
  • The paper states that the neural nonlinear solver in the encoded space has the biggest impact on the performance, while the Dirichlet layer ensures reliable models that strictly respect Dirichlet boundary conditions. In Appendix C.7, the paper concludes from the comparison with (A) that the nonlinear loop in the encoded space is indispensable for machine learning.
  • (G) also satisfies the Dirichlet boundary conditions, but PENN is more accurate. The paper considers that this may be because the pseudoinverse decoder facilitates the spatial continuity of the outputs in addition to fulfilling the Dirichlet boundary conditions (Appendix C.7 of the original paper).

Outlook

  • The paper states that, although the property of PENN is preferable, it also limits the applicable domain, because one needs to be familiar with the concrete form of the PDE of interest to construct an effective PENN model. For instance, the proposed model cannot exploit its potential to solve inverse problems where explicit forms of the governing PDE are not available. Therefore, the paper suggests that combining PINNs and PENNs could be the next direction of the research community.
  • In Appendix C.6, noting that the performance of MP-PDE improves as the time window size increases, the paper names, as one of its future directions, incorporating the temporal bundling and the pushforward trick of MP-PDE into PENN to predict the state after a far longer time.