Publications

Back to Peer-reviewed conference papers

Graph Neural PDE Solvers with Conservation and Similarity-Equivariance

Authors
M. Horie†, N. Mitsume
Published in
International Conference on Machine Learning (ICML)
Year
2024
Type
Peer-reviewed conference papers
Link
https://openreview.net/forum?id=WajJf47TUi
arXiv
https://arxiv.org/abs/2405.16183
Topics
Machine learning and data science Traffic and pedestrian flow Fluid dynamics
Keywords
Graph neural PDE solver Conservation law Similarity-equivariance Graph neural network Partial differential equation Equivariance Physics FluxGNN Locally conservative GNN Generalization to unseen spatial domains
Note
採択率 27.5%
グラフィカルアブストラクト
グラフィカルアブストラクト

概要

偏微分方程式(PDE)で記述される物理現象の予測に機械学習を使う研究が、活発に行われています。既存のデータを活用して予測を速くできるためです。しかし、解析領域とその中の状態は多様で、データに基づく手法だけですべての場合を網羅するのは困難です。さらに、機械学習のモデルは保存則や対称性などの物理法則を破ることが多く、汎化性能と信頼性に懸念があります。

本論文は、保存則を厳密に満たし、相似変換(並進、回転、鏡映、拡大縮小)に対して同変な機械学習のモデル、flux-passing graph neural network(FluxGNN)を提案しています。このモデルは、任意の形状を扱えるグラフニューラルネットワーク(GNN)と、保存則と対称性を本来満たす古典的な数値解析手法である有限体積法(FVM)との類似性に基づいています。論文は、一般的な GNN が任意のグラフで物理量を保存するための条件を数学的に導き、それに基づいて FluxGNN を構成しています。テンポラルバンドリング(temporal bundling)、ニューラル非線形ソルバー、境界エンコーダーなどの既存の機械学習の手法は、わずかな変更か変更なしで取り込めます。移流拡散方程式と混合流体の Navier–Stokes 方程式の実験で、論文は、物理法則を取り入れたことで汎化性能が大きく向上したと報告しています。学習に使っていない解析領域で、他のモデルの精度は下がる一方、FluxGNN では大きな精度の低下は見られませんでした。コードは https://github.com/yellowshippo/fluxgnn-icml2024 で公開されています。

重要点

1. GNN が保存則を満たす条件:局所保存型 GNN

代表的な GNN であるメッセージパッシングニューラルネットワーク(MPNN)は、グラフの各頂点の信号を次のように更新します。

mij=fmessage(hi,hj,hij),hiout=fupdate(hi,∑j∈Nimij)(5)\begin{aligned} \boldsymbol{m}_{ij} &= \boldsymbol{f}_{\mathrm{message}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}), \\ \boldsymbol{h}_i^{\mathrm{out}} &= \boldsymbol{f}_{\mathrm{update}}\left( \boldsymbol{h}_i, \sum_{j \in \mathcal{N}_i} \boldsymbol{m}_{ij} \right) \end{aligned} \tag{5}

ここで、hi\boldsymbol{h}_i は ii 番目の頂点の信号、hij\boldsymbol{h}_{ij} は辺 (i,j)(i, j) の信号、Ni\mathcal{N}_i は ii 番目の頂点に隣接する頂点の集合、mij\boldsymbol{m}_{ij} はメッセージ、hiout\boldsymbol{h}_i^{\mathrm{out}} は更新後の信号、fmessage\boldsymbol{f}_{\mathrm{message}} は頂点の間の相互作用を表すメッセージ関数、fupdate\boldsymbol{f}_{\mathrm{update}} は頂点ごとの更新を表す更新関数です。どちらの関数もニューラルネットワークです。

論文は、無向グラフについて、連続な活性化関数を持つ MPNN が、任意のグラフと任意の頂点の信号で頂点の信号の和 ∑i∈Vhi\sum_{i \in \mathcal{V}} \boldsymbol{h}_i を保存するのは、2 つの条件が成り立つときであり、またそのときに限ることを証明しています(定理 3.1)。1 つは、メッセージについての次の条件です。

mij=−mji,∀(i,j)∈E(7)\boldsymbol{m}_{ij} = -\boldsymbol{m}_{ji}, \quad \forall (i, j) \in \mathcal{E} \tag{7}

ここで、V\mathcal{V} と E\mathcal{E} はグラフの頂点の集合と辺の集合です。式 (7) は、頂点 ii が頂点 jj から受け取るメッセージと、jj が ii から受け取るメッセージが、大きさが等しく符号が逆であることを表します。もう 1 つは、更新関数についての条件です。定理 3.1 の証明(原論文の付録 C.2)で、論文は、更新関数は恒等写像であり、したがって MPNN は次のように表されることを示しています。

h~i=hi+∑j∈Nimij(33)\tilde{\boldsymbol{h}}_i = \boldsymbol{h}_i + \sum_{j \in \mathcal{N}_i} \boldsymbol{m}_{ij} \tag{33}

ここで、h~i\tilde{\boldsymbol{h}}_i は MPNN で更新した後の ii 番目の頂点の信号です。つまり、更新は、頂点の信号に受け取ったメッセージの和を足すだけです。論文は、これらの条件を満たす GNN を局所保存型 GNN と呼び、その情報のやり取りのしかたが有限体積法の数値流束(重要点 2)に似ていると述べています。証明は、頂点ごとの連続な更新関数が保存則を満たすには線形でなければならない、という補題(補題 3.2)に基づいています。

多くのグラフニューラル PDE ソルバーは、エンコード–処理–デコード型の構成を使います。これは、入力の特徴をエンコーダーで高次元の空間に埋め込み、その空間でメッセージパッシングを行い、結果をデコーダーで出力の空間に変換する構成です。この構成について論文は、モデルが保存則を満たすのは、エンコーダーが線形で、デコーダーがエンコーダーの擬似逆(より正確には左逆)であるときであり、またそのときに限ることを示しています(定理 3.3)。まとめると、局所保存型 GNN では、非線形性をメッセージ関数だけに持たせ、更新関数には持たせません。

2. FluxGNN:有限体積法の定式化に基づく GNN の層

論文は、次の保存形の PDE を対象にしています。

∂∂tu=−∇⋅F(u)+S(1)\frac{\partial}{\partial t} \boldsymbol{u} = -\nabla \cdot \boldsymbol{F}(\boldsymbol{u}) + \boldsymbol{S} \tag{1}

ここで、tt は時刻、u\boldsymbol{u} は未知のベクトル場、F\boldsymbol{F} は既知の作用素(非線形で、空間の微分演算子を含んでもよい)、S\boldsymbol{S} は既知の湧き出し項です。たとえば、移流拡散方程式や Navier–Stokes 方程式は、この形で書けます。有限体積法は、解析領域をセルに分け、式 (1) を次のように離散化します。

∂∂tViui=−∑j∈NiSijnij⋅[F(u)]ij+SiVi(3)\frac{\partial}{\partial t} V_i \boldsymbol{u}_i = -\sum_{j \in \mathcal{N}_i} S_{ij} \boldsymbol{n}_{ij} \cdot [\boldsymbol{F}(\boldsymbol{u})]_{ij} + \boldsymbol{S}_i V_i \tag{3}

ここで、ViV_i は ii 番目のセルの体積、ui\boldsymbol{u}_i と Si\boldsymbol{S}_i は ii 番目のセルの重心での u\boldsymbol{u} と S\boldsymbol{S} の値、Ni\mathcal{N}_i は ii 番目のセルに隣接するセルの集合、SijS_{ij} は面 (i,j)(i, j) の面積(湧き出し項 S\boldsymbol{S} とは別の量)、nij\boldsymbol{n}_{ij} は ii 番目のセルの外を向く面 (i,j)(i, j) の法線ベクトル、[F(u)]ij[\boldsymbol{F}(\boldsymbol{u})]_{ij} は面 (i,j)(i, j) での F(u)\boldsymbol{F}(\boldsymbol{u}) の値で、数値流束と呼ばれます。Sij=SjiS_{ij} = S_{ji}、nij=−nji\boldsymbol{n}_{ij} = -\boldsymbol{n}_{ji}、[F(u)]ij=[F(u)]ji[\boldsymbol{F}(\boldsymbol{u})]_{ij} = [\boldsymbol{F}(\boldsymbol{u})]_{ji} なので、2 つのセルが面を通してやり取りする量の和は 0 になり、面を通した u\boldsymbol{u} のやり取りは u\boldsymbol{u} の積分の総量を変えません。このように有限体積法は局所的な保存を満たし、すべてのセルで湧き出し項が 0 なら全体の保存則が成り立ちます。

論文は、式 (3) と、局所保存型 GNN の条件(重要点 1)に基づいて、次の GNN の層 FFlux\mathcal{F}_{\mathrm{Flux}} を構成しています(図 1)。

Vi[FFlux(H)]i:=Vihi−∑j∈NiSijnij⋅FML(hi,hj,hij)(9)V_i [\mathcal{F}_{\mathrm{Flux}}(\boldsymbol{H})]_i := V_i \boldsymbol{h}_i - \sum_{j \in \mathcal{N}_i} S_{ij} \boldsymbol{n}_{ij} \cdot \boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}) \tag{9}

ここで、グラフの頂点はメッシュのセルに対応し、H\boldsymbol{H} はすべての頂点の hi\boldsymbol{h}_i をまとめた頂点の信号、[FFlux(H)]i[\mathcal{F}_{\mathrm{Flux}}(\boldsymbol{H})]_i は ii 番目の頂点での層の出力、hij\boldsymbol{h}_{ij} は面 (i,j)(i, j) の特徴(MPNN の辺の特徴に当たる)、FML\boldsymbol{F}_{\mathrm{ML}} はニューラルネットワークで作る機械学習のモデルです。FML\boldsymbol{F}_{\mathrm{ML}} は数値流束のためのメッセージ関数なので、論文はこれを流束関数と呼んでいます。

一般的な GNN、有限体積法、FluxGNN の概要
図 1 一般的なグラフニューラルネットワーク(GNN)、有限体積法(FVM)、提案するモデル FluxGNN の概要。原論文の図の説明は、提案手法は GNN と有限体積法を組み合わせ、GNN による高い表現力と、有限体積法による汎化性能を実現する、としています。出典:原論文 Fig. 1(Copyright 2024 by the author(s))。

論文は、辺の信号が対称(hij=hji\boldsymbol{h}_{ij} = \boldsymbol{h}_{ji})なとき、式 (9) の層が局所保存型 GNN であるのは、流束関数が第 1 と第 2 の引数について置換不変、すなわち FML(hi,hj,hij)=FML(hj,hi,hij)\boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}) = \boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_j, \boldsymbol{h}_i, \boldsymbol{h}_{ij}) であるときであり、またそのときに限ることを証明しています(定理 3.4)。この条件を満たす式 (9) の形のモデルで、エンコーダーとデコーダーも定理 3.3 の条件を満たすものを、FluxGNN と呼びます。置換不変性は、置換不変な関数の必要十分なクラスを与える Deep Sets(Zaheer ら、2017)で実現できます。論文は、さらに次のように述べています。

  • 式 (9) は有限体積法の空間の離散化(式 (3))を含むので、FluxGNN は、空間の情報の伝わり方について、少なくとも有限体積法と同じ表現力を持ちます。
  • 面積 SijS_{ij}、体積 ViV_i、法線ベクトル nij\boldsymbol{n}_{ij} は幾何学的な量なので相似変換に対して同変であり、流束関数が相似変換に対して同変なら、FluxGNN も同変です。
  • FluxGNN は有限体積法の自然な拡張です。深層学習のフレームワークで実装するので、本質的には、自動微分の機能を加えた純粋な有限体積法の枠組みを含んでいます。

3. 局所的な量で無次元化した、相似変換に対して同変な MLP

流束関数を相似変換に対して同変にするため、論文は、既存の E(n) 同変な層(並進、回転、鏡映に対して同変)と、スケール同変な層を組み合わせています。

fsim(h):=MLP⁡(∥h/σ∥)h(10)\boldsymbol{f}_{\mathrm{sim}}(\boldsymbol{h}) := \operatorname{MLP}(\lVert \boldsymbol{h} / \sigma \rVert) \boldsymbol{h} \tag{10}

ここで、fsim\boldsymbol{f}_{\mathrm{sim}} は相似変換に対して同変な層、h\boldsymbol{h} は頂点の特徴、MLP⁡\operatorname{MLP} は多層パーセプトロン、∥⋅∥\lVert \cdot \rVert は L2L^2 ノルム、σ>0\sigma > 0 は、入力の物理量を無次元化するため、空間の解像度 Δx\Delta x や時間の解像度 Δt\Delta t などの局所的な量から決める値です。モデルの局所性を保つため、既存の研究(Wang ら、2021)が使った最小値や最大値のような、全体にわたる演算は使いません。

論文は、この σ\sigma の選び方が、古典的な PDE ソルバーの中心的な概念と強く結び付いていると述べています。たとえば、入力の特徴が速度の次元を持つとき、層は次のようになります。

MLP⁡(∥hΔx/Δt∥)h=MLP⁡(C)h(11)\operatorname{MLP}\left( \left\lVert \frac{\boldsymbol{h}}{\Delta x / \Delta t} \right\rVert \right) \boldsymbol{h} = \operatorname{MLP}(C) \boldsymbol{h} \tag{11}

ここで、CC は解析の安定性を特徴付けるクーラン数です。論文は、クーラン数が違う条件では数値的な安定性が違い、効率よく計算するには違う扱いが必要になりうるので、この形は自然であると考えています。拡散現象では、MLP への入力は、数値的な安定性に重要なもう一つの量である拡散数になります。流束関数は、これらの相似変換に対して同変な MLP を部品にして作ります。

4. 保存則を保ったまま、既存の機械学習の手法を取り込む

FluxGNN は多くの既存の手法と組み合わせられるように単純に設計されており、論文は、保存則を保ったままそれらを取り込む方法を示しています。

  • テンポラルバンドリング(1 回の順伝播の計算で KK ステップを同時に予測する手法。Brandstetter ら、2022):エンコーダーとデコーダーは保存則の条件で制約されるので、論文はこの手法を変えています。エンコーダーとデコーダーの重み行列を KK 個の部分 W(1),…,W(K)\boldsymbol{W}^{(1)}, \ldots, \boldsymbol{W}^{(K)} に分けてそれぞれを適用し、処理した特徴を Concat⁡[W(1)h,W(2)h,…,W(K)h]\operatorname{Concat}[\boldsymbol{W}^{(1)} \boldsymbol{h}, \boldsymbol{W}^{(2)} \boldsymbol{h}, \ldots, \boldsymbol{W}^{(K)} \boldsymbol{h}] のように特徴の方向に連結します。擬似逆のデコーダーでデコードした後、時間方向の滑らかさのため、線形の 1 次元 CNN の層(たとえば hout(t):=(1−w)h(t−1)+wh(t)\boldsymbol{h}_{\mathrm{out}}^{(t)} := (1 - w) \boldsymbol{h}^{(t-1)} + w \boldsymbol{h}^{(t)})を適用します。ここで、ww は学習するパラメータ、h(t)\boldsymbol{h}^{(t)} は時刻 tt のデコーダーの出力です。保存則のためにこの演算を線形にする必要があるので、元の手法とは形が違います。
  • ニューラル非線形ソルバー(Horie と Mitsume、2022):保存則と対称性を破らないので、変更なしで適用できます。全体にわたる演算を含みますが、その演算は MLP の外にあるので、モデルは局所保存型のままです。
  • 境界エンコーダー(Horie と Mitsume、2022):エンコーダーであり、この定式化では線形なので、変更は要りません。

数値実験の結果

すべてのモデルは PyTorch 1.9.1 で実装されています。比較の基準として、論文は、FluxGNN の学習する関数をすべて恒等関数にした有限体積法のソルバーを用意し、実装の大部分を FluxGNN と共有させています。これにより、機械学習による改善が明確になります。この有限体積法の実装の精度は、複数の問題で確かめられています(原論文の付録 D.1)。

移流拡散方程式

中核となる FluxGNN のモデルの表現力を示すため、論文は、保存量の輸送の基本的なモデルである、保存されるスカラー場 uu の移流拡散方程式を使っています。

∂∂tu=−∇⋅(cu−D∇u)(12)\frac{\partial}{\partial t} u = -\nabla \cdot (\boldsymbol{c} u - D \nabla u) \tag{12}

ここで、c\boldsymbol{c} は既知の速度場、D≥0D \geq 0 は既知の拡散係数です。

  • データ:学習用 100、検証用 10、テスト用 10 の軌跡を、方程式の厳密解から作っています。一様な速度(0.0 から 0.2)と、正弦波の初期条件の振幅と位相を、ランダムに変えています。拡散係数は D=10−4D = 10^{-4} で、一般に拡散が支配的な問題より難しい、移流が支配的な問題に当たります。空間と時間の解像度は Δx=0.1\Delta x = 0.1、Δt=0.1\Delta t = 0.1、解析領域の長さは 1 です。
  • モデル:与えた初期条件と速度から時系列を自己回帰的に生成する、単純な FluxGNN です(図 2)。CPU(Intel Xeon CPU E5-2695 v2 @ 2.40 GHz)で、MSE の損失と Adam の最適化手法を使って、3 時間学習しています。
移流拡散方程式のための FluxGNN のモデルの概要
図 2 移流拡散方程式のための FluxGNN のモデルの概要。エンコーダー Fencode\mathcal{F}_{\mathrm{encode}}、局所保存型 GNN FL\mathcal{F}_{\mathrm{L}}、デコーダー Fdecode\mathcal{F}_{\mathrm{decode}} からなります。モデルは時系列を出力し、損失は出力のすべてのステップで計算します。出典:原論文 Fig. 2(Copyright 2024 by the author(s))。

テストのデータセットでの結果は次のとおりです(原論文 Table 1。± は平均の標準誤差)。保存誤差は ∫t∈(0,Tmax⁡][∫Ω(H(t)−H(t=0)) dV]dt\int_{t \in (0, T_{\max}]} \left[ \int_{\Omega} (\boldsymbol{H}(t) - \boldsymbol{H}(t = 0)) \, \mathrm{d}V \right] \mathrm{d}t(Tmax⁡=1.0T_{\max} = 1.0)で定義されています。ここで、Ω\Omega は解析領域、H(t)\boldsymbol{H}(t) は時刻 tt の頂点の信号です。

手法 MSE の損失(×10−5\times 10^{-5}) 保存誤差(×10−8\times 10^{-8})
FVM 1408.47 ± 32.75 1.63 ± 0.19
FluxGNN 3.08 ± 0.08 1.75 ± 0.32
移流拡散方程式の予測の比較
図 3 テストのデータセットの 1 つのサンプルについて、時刻 t=1.0t = 1.0 での初期条件、正解、有限体積法の予測、FluxGNN の予測の比較。出典:原論文 Fig. 3(Copyright 2024 by the author(s))。
  • FluxGNN は、同じ空間と時間の解像度で、有限体積法より精度が高くなりました。有限体積法は、低い空間の解像度による数値拡散のため、拡散が強くなる傾向があります(図 3)。
  • FluxGNN は、有限体積法とほぼ同等の保存性を保っており、論文はこれを、モデルに組み込んだニューラルネットワークが保存則を壊していないことを示すものとしています。
  • 論文は、この機械学習のモデルが優れた表現力を持ち、既存のデータを活用して古典的な手法より高い精度を得られると結論付けています。

混合流体の Navier–Stokes 方程式

実用的な適用性を評価するため、論文は、既存の手法を FluxGNN に取り込んで、より複雑な問題を解いています。この問題では、速度 u\boldsymbol{u}、圧力 pp、密度 ρ\rho が複雑に相互作用します(ここでの u\boldsymbol{u} は速度を表します)。

∂∂t(ρu)=−∇⋅[ρu⊗u−μ(∇⊗u+(∇⊗u)T)]−∇pρgy−g⋅y∇ρ(13)\begin{aligned} \frac{\partial}{\partial t} (\rho \boldsymbol{u}) = &-\nabla \cdot \left[ \rho \boldsymbol{u} \otimes \boldsymbol{u} - \mu \left( \nabla \otimes \boldsymbol{u} + (\nabla \otimes \boldsymbol{u})^{\mathrm{T}} \right) \right] \\ &- \nabla p_{\rho g y} - \boldsymbol{g} \cdot \boldsymbol{y} \nabla \rho \end{aligned} \tag{13} ∂∂tα=−∇⋅[uα−Dα∇α](14)\frac{\partial}{\partial t} \alpha = -\nabla \cdot \left[ \boldsymbol{u} \alpha - D_{\alpha} \nabla \alpha \right] \tag{14}

ここで、μ\mu は粘性係数、α\alpha は低密度の流体の体積分率で、ρ=αρlow+(1−α)ρhigh\rho = \alpha \rho_{\mathrm{low}} + (1 - \alpha) \rho_{\mathrm{high}} を満たします(ρlow\rho_{\mathrm{low}} と ρhigh\rho_{\mathrm{high}} は低い密度と高い密度)。DαD_{\alpha} は α\alpha の拡散係数、g\boldsymbol{g} は重力加速度、y\boldsymbol{y} は重力の方向の高さ、pρgy=p−ρg⋅yp_{\rho g y} = p - \rho \boldsymbol{g} \cdot \boldsymbol{y} は重力のポテンシャルの影響を除いた圧力です。

  • データ:学習用 200、検証用 8、テスト用 8 の軌跡で、さまざまな形状と初期条件を含み、広く使われている古典的な PDE ソルバーである OpenFOAM で作っています。形状は学習用 5、検証用 2、テスト用 2 で、それぞれの形状を特徴付ける寸法を変えています。初期条件は、ランダムな数値解析で作っています。課題は、空間と時間の解像度を下げた領域に投影した正解の軌跡を予測することです。時間刻みは Δt=0.2\Delta t = 0.2、最大の時刻は学習で 1.6、評価で 3.2 とし、時間方向の外挿の能力も評価しています。
  • 追加のデータセット:テストのデータセットに回転と拡大縮小を施した、回転のデータセット(rotation)と拡大縮小のデータセット(scaling)です(それぞれ 8 本の軌跡)。さらに、汎化性能を調べるため、テストのサンプルより背の高い 3 つの形状のデータセット(taller)を作っています。
  • モデル:相似変換に対して同変な MLP、テンポラルバンドリング、ニューラル非線形ソルバー、境界エンコーダーを取り込んだ、自己回帰的な FluxGNN です。入力は古典的な数値解析と同じもの(メッシュの形状、初期条件、境界条件、物性値)、出力は速度 u\boldsymbol{u}、圧力 pρgyp_{\rho g y}、体積分率 α\alpha の時系列です。損失は、物理量ごとの RMSE を、損失の大きさをそろえるため標準偏差で重み付けしたものです。
  • 比較の対象:不規則な領域と境界条件を扱える最先端の機械学習のモデルである MP-PDE(Brandstetter ら、2022)と PENN(Horie と Mitsume、2022)、および上の有限体積法の実装です。機械学習のモデルは、すべて GPU(NVIDIA A100 80GB PCIe)で 3 日間学習しています。
速度場の比較
図 4 正解、MP-PDE、PENN、FluxGNN の速度場の比較。モデルごとに、test、scaling、taller、rotation のデータセットの結果を示しています。出典:原論文 Fig. 4(Copyright 2024 by the author(s))。

各評価データセットでの RMSE の損失と α\alpha の保存誤差は次のとおりです(原論文 Table 2)。各指標は標準偏差で正規化されており、± は平均の標準誤差です。

手法 データセット u\boldsymbol{u} の損失(×10−1\times 10^{-1}) pp の損失(×10−1\times 10^{-1}) α\alpha の損失(×10−1\times 10^{-1}) α\alpha の保存誤差(×10−5\times 10^{-5})
FVM test 19.501 ± 0.149 37.706 ± 0.194 2.896 ± 0.030 0.01 ± 0.00
MP-PDE test 1.532 ± 0.010 0.941 ± 0.008 1.021 ± 0.010 1001.95 ± 120.43
PENN test 0.619 ± 0.005 0.598 ± 0.005 0.358 ± 0.005 1356.62 ± 283.00
FluxGNN test 1.202 ± 0.008 1.143 ± 0.008 0.349 ± 0.005 0.06 ± 0.03
FVM rotation 18.363 ± 0.128 22.366 ± 0.123 2.930 ± 0.030 0.01 ± 0.00
MP-PDE rotation 11.523 ± 0.075 10.883 ± 0.078 9.528 ± 0.072 5307.85 ± 1009.04
PENN rotation 0.622 ± 0.004 0.592 ± 0.005 0.355 ± 0.005 1302.98 ± 153.02
FluxGNN rotation 1.207 ± 0.007 1.175 ± 0.008 0.351 ± 0.005 0.01 ± 0.00
FVM scaling 19.411 ± 0.149 38.106 ± 0.193 2.918 ± 0.030 0.01 ± 0.00
MP-PDE scaling 5.072 ± 0.034 4.211 ± 0.040 5.604 ± 0.046 6401.93 ± 1806.50
PENN scaling NaN ± NaN NaN ± NaN NaN ± NaN NaN ± NaN
FluxGNN scaling 1.219 ± 0.009 1.228 ± 0.008 0.356 ± 0.005 0.05 ± 0.01
FVM taller NaN ± NaN NaN ± NaN NaN ± NaN NaN ± NaN
MP-PDE taller 8.377 ± 0.081 2.472 ± 0.024 2.823 ± 0.033 16770.80 ± 3293.59
PENN taller 1.476 ± 0.016 1.887 ± 0.014 0.357 ± 0.006 4799.89 ± 1574.43
FluxGNN taller 1.184 ± 0.009 0.966 ± 0.008 0.337 ± 0.006 0.02 ± 0.00
  • すべての機械学習のモデルがテストのデータセットで良い性能を示しており、学習がうまくいったことを示しています。また、どのモデルも、学習で見たものより長い時系列を予測できます。
  • FluxGNN は、既存の機械学習の手法の部品を取り込んでも高い保存性を保ちますが、他の機械学習のモデルは保ちません。論文は、保存則を満たすには特別な扱いが必要であることが浮き彫りになったと述べています。
  • 回転のデータセットでは、PENN は E(n) 同変性によって良い性能を示し、MP-PDE は精度が下がり始めます。
  • 拡大縮小のデータセットでは、PENN は発散します(表の NaN)。主な原因は、入力の値が大きく変わって外挿になることです。FluxGNN は拡大縮小の前後でほぼ同じ性能を示し、スケール同変性を示しています。わずかな違いは、自己回帰的な計算で蓄積した数値誤差によるものと論文は考えています。
  • 背の高い形状のデータセットでは、拡大縮小が関係しないにもかかわらず、FluxGNN は良い性能を示しました。論文は、PENN が E(n) 同変性を持っていても性能が下がり、背の高いサンプルの上部に見かけの速度が現れる(図 4)ことから、汎化性能には保存則が不可欠であることが示唆されると述べています。有限体積法は、背の高い形状のデータセットでは、試したすべての設定で発散する傾向があり、収束しませんでした。論文はこれを、FluxGNN がニューラルネットワークの表現力を活かしていることを示すものとしています。
  • これらの結果から、論文は、FluxGNN が古典的な PDE ソルバーと機械学習の手法を高い水準で組み合わせ、高い汎化性能と表現力を実現していると主張しています。

図 5 は、各機械学習のモデルのハイパーパラメータを変えて得た、速度と精度のトレードオフです。計算は、移流拡散方程式の例題と同じ CPU の 1 コアで行っています。

速度と精度のトレードオフ
図 5 MP-PDE、PENN、FluxGNN のハイパーパラメータの調査で得た、速度と精度のトレードオフ。誤差棒は平均の標準誤差です。薄い色と濃い色は、それぞれ test と taller のデータセットでの評価です。線はパレートフロントで、矢印は評価するデータセットを変えたことによるフロントの移動を表します。有限体積法の結果は、パレートフロントから遠いので示していません。出典:原論文 Fig. 5(Copyright 2024 by the author(s))。
  • テストのデータセットでは、どのモデルにも明確な優位性はありません。
  • 背の高い形状のデータセットでは、FluxGNN は比較のモデルより明確に優位です。さらに、FluxGNN のパレートフロントは損失の方向にほとんど移動しておらず、論文はこれを、FluxGNN が精度を落とさずに空間の外挿に汎化することを意味するとしています。

論文は、さらに長い時間の予測も行っています。

  • 論文は、FluxGNN の全体の損失が、t≈7.0t \approx 7.0 の後、数値的な不安定のため MP-PDE より高くなり始めると述べています(原論文 Fig. 6)。
  • FluxGNN は高い保存性を保ちます(図 6)。不安定が目立つようになった後も、その保存誤差は他の機械学習の手法より桁違いに小さく、論文はこれが、FluxGNN がより長い時間の予測に使える可能性を示すとしています。
  • 論文は、時系列の予測をより安定にする pushforward trick(Brandstetter ら、2022)を取り込んでおらず、これを取り込むことや、計算物理の分野で安定化に有効とされる流束制限関数と勾配制限関数を取り込むことで、この点を改善できる可能性があるとしています。
保存誤差の時間変化
図 6 さらに長い時間の予測での、有限体積法(FVM)、MP-PDE、PENN、FluxGNN の保存誤差の時間変化。縦軸は対数目盛りです。出典:原論文 Fig. 7(Copyright 2024 by the author(s))。

今後の展開

  • 論文は、本研究は流れと輸送の現象に対応する PDE を対象にしましたが、局所保存型 GNN は汎用的な構造を持つので、最適輸送やグラフ上の交通流など、より広い問題に適用できると述べています。
  • 論文は、よく最適化された古典的なソルバーとの性能の比較を行っておらず、これを本研究の限界としています。FluxGNN は実装の大部分を共有する有限体積法に対して明確な改善を示したので、よく最適化されたソルバーの上に FluxGNN を実装することが次の段階の一つであり、速度と精度を大きく改善できる可能性があるとしています。
  • もう一つの限界は、長時間の予測で手法をより安定にする必要があることです。論文は、流束制限関数と勾配制限関数を取り込むことで改善できる可能性があると述べ、本研究の焦点は空間的な領域外への汎化に向けた信頼できる手法の構築であるため、これを今後の課題としています。
Graphical abstract
Graphical abstract

Overview

Machine learning for predicting physical phenomena described by partial differential equations (PDEs) has been actively studied, because it can speed up predictions by leveraging existing data. However, the variety of analysis domains and of the states within them makes it difficult to cover all scenarios with data-driven approaches alone. Moreover, machine learning models often violate physical laws such as conservation and symmetry, which raises concerns about their generalizability and reliability.

This paper proposes flux-passing graph neural networks (FluxGNNs), a machine learning model that rigorously satisfies conservation laws and is equivariant to similarity transformations (translation, rotation, reflection, and scaling). The model builds on graph neural networks (GNNs), which can handle arbitrary shapes, and on the parallels between GNNs and the finite volume method (FVM), a classical numerical analysis method that inherently respects conservation and symmetries. The paper mathematically derives the conditions under which typical GNNs conserve physical quantities on arbitrary graphs, and constructs FluxGNN on that basis. Existing machine learning techniques, such as temporal bundling, the neural nonlinear solver, and boundary encoders, can be incorporated with minimal or no modifications. In experiments on the convection–diffusion equation and the Navier–Stokes equations with a mixture, the paper reports that including physical laws significantly improves generalizability: FluxGNN shows no significant accuracy degradation for unseen spatial domains, whereas the other models degrade. The code is available at https://github.com/yellowshippo/fluxgnn-icml2024.

Key points

1. Conditions for GNNs to satisfy conservation laws: locally conservative GNNs

A typical GNN, the message passing neural network (MPNN), updates the signal on each vertex of a graph as follows.

mij=fmessage(hi,hj,hij),hiout=fupdate(hi,∑j∈Nimij)(5)\begin{aligned} \boldsymbol{m}_{ij} &= \boldsymbol{f}_{\mathrm{message}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}), \\ \boldsymbol{h}_i^{\mathrm{out}} &= \boldsymbol{f}_{\mathrm{update}}\left( \boldsymbol{h}_i, \sum_{j \in \mathcal{N}_i} \boldsymbol{m}_{ij} \right) \end{aligned} \tag{5}

Here, hi\boldsymbol{h}_i is the signal at the ii-th vertex, hij\boldsymbol{h}_{ij} is the signal on the edge (i,j)(i, j), Ni\mathcal{N}_i is the set of vertices neighboring the ii-th vertex, mij\boldsymbol{m}_{ij} is the message, hiout\boldsymbol{h}_i^{\mathrm{out}} is the updated signal, fmessage\boldsymbol{f}_{\mathrm{message}} is the message function expressing the interaction between vertices, and fupdate\boldsymbol{f}_{\mathrm{update}} is the update function describing the vertex-wise update. Both functions are neural networks.

For undirected graphs, the paper proves that an MPNN with continuous activation functions conserves the sum of the vertex signals ∑i∈Vhi\sum_{i \in \mathcal{V}} \boldsymbol{h}_i for any graph and any vertex signal if and only if two conditions hold (Theorem 3.1). One is the following condition on the messages.

mij=−mji,∀(i,j)∈E(7)\boldsymbol{m}_{ij} = -\boldsymbol{m}_{ji}, \quad \forall (i, j) \in \mathcal{E} \tag{7}

Here, V\mathcal{V} and E\mathcal{E} are the vertex set and the edge set of the graph. Equation (7) states that the message that vertex ii receives from vertex jj and the message that jj receives from ii have the same magnitude and opposite signs. The other is a condition on the update function. In the proof of Theorem 3.1 (Appendix C.2 of the paper), the paper shows that the update function is the identity, and thus the MPNN is expressed as follows.

h~i=hi+∑j∈Nimij(33)\tilde{\boldsymbol{h}}_i = \boldsymbol{h}_i + \sum_{j \in \mathcal{N}_i} \boldsymbol{m}_{ij} \tag{33}

Here, h~i\tilde{\boldsymbol{h}}_i is the signal at the ii-th vertex after the update by the MPNN. In other words, the update only adds the sum of the received messages to the vertex signal. The paper calls GNNs that satisfy these conditions locally conservative GNNs, and notes that the way they exchange information resembles the numerical flux of the FVM (Key point 2). The proof rests on the lemma that a vertex-wise continuous update function must be linear to achieve conservation (Lemma 3.2).

Most graph neural PDE solvers use the encode-process-decode architecture, which embeds the input features into a higher-dimensional space with an encoder, performs message passing in that space, and converts the result into the output space with a decoder. For this architecture, the paper shows that the model is conservative if and only if the encoder is linear and the decoder is the pseudoinverse (more specifically, the left inverse) of the encoder (Theorem 3.3). In short, a locally conservative GNN confines its nonlinearity to the message function and does not use nonlinearity in the update function.

2. FluxGNN: a GNN layer built on the formulation of the finite volume method

The paper considers PDEs in the following conservation form.

∂∂tu=−∇⋅F(u)+S(1)\frac{\partial}{\partial t} \boldsymbol{u} = -\nabla \cdot \boldsymbol{F}(\boldsymbol{u}) + \boldsymbol{S} \tag{1}

Here, tt is time, u\boldsymbol{u} is the unknown vector field, F\boldsymbol{F} is a known operator that may be nonlinear and contain spatial differential operators, and S\boldsymbol{S} is a known source term. The convection–diffusion equation and the Navier–Stokes equations, for example, can be written in this form. The FVM divides the analysis domain into cells and discretizes Eq. (1) as follows.

∂∂tViui=−∑j∈NiSijnij⋅[F(u)]ij+SiVi(3)\frac{\partial}{\partial t} V_i \boldsymbol{u}_i = -\sum_{j \in \mathcal{N}_i} S_{ij} \boldsymbol{n}_{ij} \cdot [\boldsymbol{F}(\boldsymbol{u})]_{ij} + \boldsymbol{S}_i V_i \tag{3}

Here, ViV_i is the volume of the ii-th cell, ui\boldsymbol{u}_i and Si\boldsymbol{S}_i are the values of u\boldsymbol{u} and S\boldsymbol{S} at the centroid of the ii-th cell, Ni\mathcal{N}_i is the set of cells neighboring the ii-th cell, SijS_{ij} is the area of the face (i,j)(i, j) (a different quantity from the source term S\boldsymbol{S}), nij\boldsymbol{n}_{ij} is the normal vector of the face (i,j)(i, j) pointing outside of the ii-th cell, and [F(u)]ij[\boldsymbol{F}(\boldsymbol{u})]_{ij} is the value of F(u)\boldsymbol{F}(\boldsymbol{u}) at the face (i,j)(i, j), called the numerical flux. Because Sij=SjiS_{ij} = S_{ji}, nij=−nji\boldsymbol{n}_{ij} = -\boldsymbol{n}_{ji}, and [F(u)]ij=[F(u)]ji[\boldsymbol{F}(\boldsymbol{u})]_{ij} = [\boldsymbol{F}(\boldsymbol{u})]_{ji}, the amounts exchanged through a face by the two cells sum to zero, and exchanging u\boldsymbol{u} through a face does not change its total integral. The FVM thus holds local conservation, and the global conservation law holds when the source term is zero in all cells.

Based on Eq. (3) and the conditions for locally conservative GNNs (Key point 1), the paper constructs the following GNN layer FFlux\mathcal{F}_{\mathrm{Flux}} (Figure 1).

Vi[FFlux(H)]i:=Vihi−∑j∈NiSijnij⋅FML(hi,hj,hij)(9)V_i [\mathcal{F}_{\mathrm{Flux}}(\boldsymbol{H})]_i := V_i \boldsymbol{h}_i - \sum_{j \in \mathcal{N}_i} S_{ij} \boldsymbol{n}_{ij} \cdot \boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}) \tag{9}

Here, the vertices of the graph correspond to the cells of the mesh, H\boldsymbol{H} is the vertex signal that collects hi\boldsymbol{h}_i for all vertices, [FFlux(H)]i[\mathcal{F}_{\mathrm{Flux}}(\boldsymbol{H})]_i is the output of the layer at the ii-th vertex, hij\boldsymbol{h}_{ij} is the feature at the face (i,j)(i, j), corresponding to an edge feature in the MPNN, and FML\boldsymbol{F}_{\mathrm{ML}} is a machine learning model constructed with neural networks. Because FML\boldsymbol{F}_{\mathrm{ML}} is a message function for the numerical flux, the paper calls it a flux function.

Overview of a typical GNN, the FVM, and FluxGNN
Figure 1. Overview of a typical graph neural network (GNN), the finite volume method (FVM), and the proposed model, FluxGNN. The original caption states that the method combines the GNN and the FVM, realizing high expressibility from the GNN and generalizability from the FVM. Source: Fig. 1 of the original paper (Copyright 2024 by the author(s)).

The paper proves that, for a symmetric edge signal hij=hji\boldsymbol{h}_{ij} = \boldsymbol{h}_{ji}, the layer of Eq. (9) is a locally conservative GNN if and only if the flux function is permutation-invariant for its first and second arguments, that is, FML(hi,hj,hij)=FML(hj,hi,hij)\boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_i, \boldsymbol{h}_j, \boldsymbol{h}_{ij}) = \boldsymbol{F}_{\mathrm{ML}}(\boldsymbol{h}_j, \boldsymbol{h}_i, \boldsymbol{h}_{ij}) (Theorem 3.4). Models of the form of Eq. (9) that satisfy this condition, with encoders and decoders that also satisfy the condition of Theorem 3.3, are called FluxGNNs. The permutation invariance can be realized with deep sets (Zaheer et al., 2017), which offer the necessary and sufficient class of permutation-invariant functions. The paper also states the following.

  • Because Eq. (9) contains the spatial discretization of the FVM (Eq. (3)), FluxGNN has at least the same expressive power as the FVM concerning information propagation in space.
  • The area SijS_{ij}, the volume ViV_i, and the normal vector nij\boldsymbol{n}_{ij} are geometrical quantities and are therefore similarity-equivariant, so FluxGNN is similarity-equivariant when the flux function is.
  • FluxGNN is a natural extension of the FVM. Thanks to its implementation in a deep learning framework, it essentially encompasses a pure FVM framework enhanced with automatic differentiation.

3. Similarity-equivariant MLPs made dimensionless with local quantities

To make the flux function similarity-equivariant, the paper combines the existing E(n)-equivariant layer (equivariant to translation, rotation, and reflection) with a scale-equivariant layer.

fsim(h):=MLP⁡(∥h/σ∥)h(10)\boldsymbol{f}_{\mathrm{sim}}(\boldsymbol{h}) := \operatorname{MLP}(\lVert \boldsymbol{h} / \sigma \rVert) \boldsymbol{h} \tag{10}

Here, fsim\boldsymbol{f}_{\mathrm{sim}} is the similarity-equivariant layer, h\boldsymbol{h} is the feature at a vertex, MLP⁡\operatorname{MLP} is a multilayer perceptron, ∥⋅∥\lVert \cdot \rVert is the L2L^2-norm, and σ>0\sigma > 0 is determined from local quantities, such as the spatial resolution Δx\Delta x and the temporal resolution Δt\Delta t, to make the input physical quantities dimensionless. The paper avoids global operators, such as the min and max used in an existing study (Wang et al., 2021), to retain the locality of the model.

The paper states that this choice of σ\sigma has a strong connection with central concepts of classical PDE solvers. For example, when the input feature has the dimension of velocity, the layer becomes the following.

MLP⁡(∥hΔx/Δt∥)h=MLP⁡(C)h(11)\operatorname{MLP}\left( \left\lVert \frac{\boldsymbol{h}}{\Delta x / \Delta t} \right\rVert \right) \boldsymbol{h} = \operatorname{MLP}(C) \boldsymbol{h} \tag{11}

Here, CC is the Courant number, which characterizes the stability of the simulation. The paper considers this formulation natural, because a condition with a different Courant number can require a different treatment for efficient computation owing to its different numerical stability. For diffusion phenomena, the input to the MLP becomes the diffusion number, another essential quantity for numerical stability. The flux functions are constructed with these similarity-equivariant MLPs as building blocks.

4. Incorporating existing machine learning methods while keeping conservation

FluxGNN is designed to be simple enough to be compatible with many existing methods, and the paper shows how to incorporate them while maintaining conservation.

  • Temporal bundling (predicting KK time steps simultaneously with a single forward computation; Brandstetter et al., 2022): because the encoder and decoder are constrained by the conditions for conservation, the paper modifies this method. The weight matrices of the encoder and decoder are divided into KK segments W(1),…,W(K)\boldsymbol{W}^{(1)}, \ldots, \boldsymbol{W}^{(K)}, each applied separately, and the processed features are concatenated in the feature direction as Concat⁡[W(1)h,W(2)h,…,W(K)h]\operatorname{Concat}[\boldsymbol{W}^{(1)} \boldsymbol{h}, \boldsymbol{W}^{(2)} \boldsymbol{h}, \ldots, \boldsymbol{W}^{(K)} \boldsymbol{h}]. After decoding with the pseudoinverse decoder, linear 1D-CNN layers, for example hout(t):=(1−w)h(t−1)+wh(t)\boldsymbol{h}_{\mathrm{out}}^{(t)} := (1 - w) \boldsymbol{h}^{(t-1)} + w \boldsymbol{h}^{(t)}, are applied to facilitate temporal smoothness. Here, ww is a trainable parameter and h(t)\boldsymbol{h}^{(t)} is the output of the decoders at time tt. This form differs from the original method because the operation needs to be linear for conservation.
  • Neural nonlinear solver (Horie and Mitsume, 2022): it can be applied without modification because it does not break conservation laws and symmetries. Although it contains global operations, the model remains locally conservative because these operations exist outside of the MLPs.
  • Boundary encoders (Horie and Mitsume, 2022): they need no modification because they are encoders, which are linear in this formulation.

Numerical results

All models are implemented with PyTorch 1.9.1. As a baseline, the paper prepares an FVM solver obtained by making all trainable functions of FluxGNN identity functions, so that most of the implementation is shared between the solver and FluxGNN. This setup highlights the improvement brought by machine learning. The accuracy of this FVM implementation was verified on multiple problems (Appendix D.1 of the paper).

Convection–diffusion equation

To demonstrate the expressive capability of the core FluxGNN model, the paper uses the convection–diffusion equation for a conservative scalar field uu, a fundamental model for the transport of conservative quantities.

∂∂tu=−∇⋅(cu−D∇u)(12)\frac{\partial}{\partial t} u = -\nabla \cdot (\boldsymbol{c} u - D \nabla u) \tag{12}

Here, c\boldsymbol{c} is a known velocity field and D≥0D \geq 0 is a known diffusion coefficient.

  • Data: 100 trajectories for training, 10 for validation, and 10 for testing, derived from the exact solution of the equation with random variations in the uniform velocity (from 0.0 to 0.2) and in the amplitude and phase of the sinusoidal initial condition. The diffusion coefficient is D=10−4D = 10^{-4}, corresponding to a convection-dominant problem, which is generally more challenging than a diffusive one. The spatial and temporal resolutions are Δx=0.1\Delta x = 0.1 and Δt=0.1\Delta t = 0.1, and the analysis domain is one unit long.
  • Model: a straightforward FluxGNN that autoregressively generates a time series from the given initial condition and velocity (Figure 2). It was trained on a CPU (Intel Xeon CPU E5-2695 v2 @ 2.40 GHz) for 3 hours with the MSE loss and the Adam optimizer.
Overview of the FluxGNN model for the convection–diffusion equation
Figure 2. Overview of the FluxGNN model for the convection–diffusion equation, with an encoder Fencode\mathcal{F}_{\mathrm{encode}}, a locally conservative GNN FL\mathcal{F}_{\mathrm{L}}, and a decoder Fdecode\mathcal{F}_{\mathrm{decode}}. The model outputs a time series, and the loss is computed using all steps of the output. Source: Fig. 2 of the original paper (Copyright 2024 by the author(s)).

The results on the test dataset are as follows (Table 1 of the original paper; ± is the standard error of the mean). The conservation error is defined as ∫t∈(0,Tmax⁡][∫Ω(H(t)−H(t=0)) dV]dt\int_{t \in (0, T_{\max}]} \left[ \int_{\Omega} (\boldsymbol{H}(t) - \boldsymbol{H}(t = 0)) \, \mathrm{d}V \right] \mathrm{d}t with Tmax⁡=1.0T_{\max} = 1.0, where Ω\Omega is the analysis domain and H(t)\boldsymbol{H}(t) is the vertex signal at time tt.

Method MSE loss (×10−5\times 10^{-5}) Conservation error (×10−8\times 10^{-8})
FVM 1408.47 ± 32.75 1.63 ± 0.19
FluxGNN 3.08 ± 0.08 1.75 ± 0.32
Comparison of the predictions for the convection–diffusion equation
Figure 3. Comparison of the initial condition, the ground truth, the prediction of the FVM, and the prediction of FluxGNN for a sample in the test dataset at time t=1.0t = 1.0. Source: Fig. 3 of the original paper (Copyright 2024 by the author(s)).
  • FluxGNN is more accurate than the FVM at the same spatiotemporal resolution. The FVM tends to be more diffusive because of the numerical diffusion caused by the low spatial resolution (Figure 3).
  • FluxGNN maintains a conservation property almost equivalent to that of the FVM, which the paper takes as an indication that the neural networks in the model do not disrupt the conservation law.
  • The paper concludes that the machine learning model has superior expressive power and can leverage existing data to achieve higher accuracy than the classical method.

Navier–Stokes equations with a mixture

To evaluate practical applicability, the paper tests a more complex problem with existing methods incorporated into FluxGNN. The problem involves intricate interactions among the velocity u\boldsymbol{u}, the pressure pp, and the density ρ\rho (here, u\boldsymbol{u} denotes the velocity).

∂∂t(ρu)=−∇⋅[ρu⊗u−μ(∇⊗u+(∇⊗u)T)]−∇pρgy−g⋅y∇ρ(13)\begin{aligned} \frac{\partial}{\partial t} (\rho \boldsymbol{u}) = &-\nabla \cdot \left[ \rho \boldsymbol{u} \otimes \boldsymbol{u} - \mu \left( \nabla \otimes \boldsymbol{u} + (\nabla \otimes \boldsymbol{u})^{\mathrm{T}} \right) \right] \\ &- \nabla p_{\rho g y} - \boldsymbol{g} \cdot \boldsymbol{y} \nabla \rho \end{aligned} \tag{13} ∂∂tα=−∇⋅[uα−Dα∇α](14)\frac{\partial}{\partial t} \alpha = -\nabla \cdot \left[ \boldsymbol{u} \alpha - D_{\alpha} \nabla \alpha \right] \tag{14}

Here, μ\mu is the dynamic viscosity, α\alpha is the volume fraction of the low-density fluid, which satisfies ρ=αρlow+(1−α)ρhigh\rho = \alpha \rho_{\mathrm{low}} + (1 - \alpha) \rho_{\mathrm{high}} (ρlow\rho_{\mathrm{low}} and ρhigh\rho_{\mathrm{high}} are the low and high densities), DαD_{\alpha} is the diffusion coefficient for α\alpha, g\boldsymbol{g} is the gravitational acceleration, y\boldsymbol{y} is the height in the direction of gravity, and pρgy=p−ρg⋅yp_{\rho g y} = p - \rho \boldsymbol{g} \cdot \boldsymbol{y} is the pressure without the effect of the gravitational potential.

  • Data: 200 trajectories for training, 8 for validation, and 8 for testing, which cover various shapes and initial conditions and were generated with OpenFOAM, a widely recognized classical PDE solver. Five shapes were used for training, two for validation, and two for testing, with variations in the dimensions characterizing each shape, and the initial conditions were created by random numerical analysis. The task is to predict the ground truth trajectories projected onto domains with lower spatiotemporal resolution. The time step is Δt=0.2\Delta t = 0.2, and the maximum time is 1.6 for training and 3.2 for evaluation, so that the ability for temporal extrapolation is also assessed.
  • Additional datasets: a rotation dataset and a scaling dataset (eight trajectories each), created by applying rotation and scaling to the test dataset. In addition, a taller dataset of three shapes taller than the test samples was generated to test generalizability.
  • Model: an autoregressive FluxGNN that incorporates similarity-equivariant MLPs, temporal bundling, neural nonlinear solvers, and boundary encoders. The inputs are aligned with those of classical numerical analysis (mesh geometry, initial conditions, boundary conditions, and material properties), and the outputs are time series of the velocity u\boldsymbol{u}, the pressure pρgyp_{\rho g y}, and the volume fraction α\alpha. The loss is the RMSE of each physical quantity, weighted by its standard deviation to balance the loss magnitudes.
  • Comparison: MP-PDE (Brandstetter et al., 2022) and PENN (Horie and Mitsume, 2022), state-of-the-art machine learning models that accommodate irregular domains and boundary conditions, and the FVM implementation described above. All machine learning models were trained on GPUs (NVIDIA A100 80GB PCIe) for three days.
Visual comparison of the velocity field
Figure 4. Visual comparison of the velocity field among the ground truth, MP-PDE, PENN, and FluxGNN. For each model, the results on the test, scaling, taller, and rotation datasets are shown. Source: Fig. 4 of the original paper (Copyright 2024 by the author(s)).

The RMSE loss and the conservation error of α\alpha on each evaluation dataset are as follows (Table 2 of the original paper). Each metric is normalized using the standard deviation, and ± is the standard error of the mean.

Method Dataset Loss u\boldsymbol{u} (×10−1\times 10^{-1}) Loss pp (×10−1\times 10^{-1}) Loss α\alpha (×10−1\times 10^{-1}) Conservation error α\alpha (×10−5\times 10^{-5})
FVM test 19.501 ± 0.149 37.706 ± 0.194 2.896 ± 0.030 0.01 ± 0.00
MP-PDE test 1.532 ± 0.010 0.941 ± 0.008 1.021 ± 0.010 1001.95 ± 120.43
PENN test 0.619 ± 0.005 0.598 ± 0.005 0.358 ± 0.005 1356.62 ± 283.00
FluxGNN test 1.202 ± 0.008 1.143 ± 0.008 0.349 ± 0.005 0.06 ± 0.03
FVM rotation 18.363 ± 0.128 22.366 ± 0.123 2.930 ± 0.030 0.01 ± 0.00
MP-PDE rotation 11.523 ± 0.075 10.883 ± 0.078 9.528 ± 0.072 5307.85 ± 1009.04
PENN rotation 0.622 ± 0.004 0.592 ± 0.005 0.355 ± 0.005 1302.98 ± 153.02
FluxGNN rotation 1.207 ± 0.007 1.175 ± 0.008 0.351 ± 0.005 0.01 ± 0.00
FVM scaling 19.411 ± 0.149 38.106 ± 0.193 2.918 ± 0.030 0.01 ± 0.00
MP-PDE scaling 5.072 ± 0.034 4.211 ± 0.040 5.604 ± 0.046 6401.93 ± 1806.50
PENN scaling NaN ± NaN NaN ± NaN NaN ± NaN NaN ± NaN
FluxGNN scaling 1.219 ± 0.009 1.228 ± 0.008 0.356 ± 0.005 0.05 ± 0.01
FVM taller NaN ± NaN NaN ± NaN NaN ± NaN NaN ± NaN
MP-PDE taller 8.377 ± 0.081 2.472 ± 0.024 2.823 ± 0.033 16770.80 ± 3293.59
PENN taller 1.476 ± 0.016 1.887 ± 0.014 0.357 ± 0.006 4799.89 ± 1574.43
FluxGNN taller 1.184 ± 0.009 0.966 ± 0.008 0.337 ± 0.006 0.02 ± 0.00
  • All machine learning models perform well on the test dataset, indicating successful training, and all of them can predict time series longer than those observed during training.
  • FluxGNN keeps a high level of conservation even when it incorporates components from existing machine learning methods, whereas the other machine learning models do not. The paper states that this highlights the need for special treatment to adhere to conservation laws.
  • On the rotation dataset, PENN performs well owing to its E(n)-equivariance, whereas MP-PDE begins to degrade.
  • On the scaling dataset, PENN shows divergent behavior (NaN in the table), mainly because the significant changes in the input values lead to extrapolation. FluxGNN performs nearly identically before and after scaling, showing its scale equivariance. The paper attributes the slight variation to numerical errors accumulated during the autoregressive computation.
  • On the taller dataset, FluxGNN performs well even though scaling is not involved. The paper states that this implies that conservation is essential for generalizability, because PENN degrades even with E(n)-equivariance and shows a spurious emergence of velocity at the top of the taller sample (Figure 4). The FVM tends to diverge and never reaches convergence on the taller dataset in any of the tested settings, which the paper takes as showing that FluxGNN leverages the expressive power of neural networks.
  • From these results, the paper claims that FluxGNN combines the methods of classical PDE solvers and machine learning at a high level, realizing high generalizability and expressibility.

Figure 5 shows the speed–accuracy tradeoff obtained by varying the hyperparameters of each machine learning model, computed on one core of the same CPU as in the convection–diffusion example.

Speed–accuracy tradeoff
Figure 5. Speed–accuracy tradeoff obtained through hyperparameter studies for MP-PDE, PENN, and FluxGNN, with error bars corresponding to the standard error of the mean. Light and dark colors correspond to the evaluation on the test and taller datasets, respectively. Lines represent Pareto fronts, and arrows denote the shifts of the fronts caused by the change of the evaluation dataset. The FVM results are not shown because they are far from the Pareto fronts. Source: Fig. 5 of the original paper (Copyright 2024 by the author(s)).
  • On the test dataset, none of the models has a clear advantage.
  • On the taller dataset, FluxGNN has a clear advantage over the baseline models. Moreover, the Pareto front of FluxGNN does not shift significantly in the direction of the loss, which the paper states means that FluxGNN generalizes for spatial extrapolation without losing accuracy.

The paper also performs predictions for an even longer temporal rollout.

  • The paper states that the total loss of FluxGNN starts to become higher than that of MP-PDE after t≈7.0t \approx 7.0, owing to numerical instability (Fig. 6 of the original paper).
  • FluxGNN maintains a high level of conservation (Figure 6). Even after the instability becomes evident, its conservation error is lower than those of the other machine learning methods by orders of magnitude, which the paper states implies the potential of FluxGNN for a more extended temporal rollout.
  • The paper did not include the pushforward trick (Brandstetter et al., 2022), which realizes more stable time-series prediction, and suggests that incorporating it, or flux and slope limiters known as effective methods for stability in computational physics, may address this point.
Time evolution of the conservation error
Figure 6. Time evolution of the conservation error for the FVM, MP-PDE, PENN, and FluxGNN in the longer temporal rollout. The vertical axis is in log scale. Source: Fig. 7 of the original paper (Copyright 2024 by the author(s)).

Outlook

  • The paper states that, although this study focused on PDEs corresponding to flow and transport phenomena, the locally conservative GNNs have a generic structure and can be applied to a broader class of problems, such as optimal transport and traffic flow on graphs.
  • The paper did not analyze performance in comparison with well-optimized classical solvers, which it notes as a limitation of the work. Because FluxGNN showed a clear improvement over the FVM that shares most of its implementation, one possible next step is to implement FluxGNN on top of well-optimized solvers, which may drastically improve speed and accuracy.
  • Another limitation is that the method needs to be more stable for long-term prediction. The paper states that this may be addressed by incorporating flux and slope limiters, and leaves it as future work because the focus of this work is to construct a reliable method toward spatially out-of-domain generalization.