Abstract: The physics-informed neural network (PINN) is effective in solving the partial differential equation (PDE) by capturing the physics constraints as a part of the training loss function through the Automatic Differentiation (AD). This study proposes the hybrid finite difference with the physics-informed neural network (HFD-PINN) to fully use the domain knowledge. The main idea is to use the finite difference method (FDM) locally instead of AD in the framework of PINN. In particular, we use AD at complex boundaries and the FDM in other domains. The hybrid learning model shows promising results in experiments. To use the FDM locally in the complex boundary domain and avoid the generation of background mesh, we propose the HFD-PINN-sdf method, which locally uses the finite difference scheme at random points. In addition, the signed distance function is used to avoid the difference scheme from crossing the domain boundary. In this paper, we demonstrate the performance of our proposed methods and compare the results with the different number of collocation points for the Poisson equation, Burgers equation. We also chose several different finite difference schemes, including the compact finite difference method (CDM) and crank-nicolson method (CNM), to verify the robustness of HFD-PINN. We take the heat conduction problem and the heat transfer problem on the irregular domain as examples to demonstrate the efficacy of our framework. In summary, HFD-PINN, especially HFD-PINN-sdf, are more instructive and efficient, significantly when solving PDEs in complex geometries.
Introduction
Physics-Informed Neural Networks (PINNs) have revolutionized the numerical solution of Partial Differential Equations (PDEs) by embedding physical laws directly into a neural network's loss function using Automatic Differentiation (AD). While flexible and mesh-free, AD-based PINNs often struggle with slow convergence and lower accuracy compared to traditional numerical methods. Conversely, the Finite Difference Method (FDM) is highly accurate and stable but traditionally requires structured grids, making it difficult to apply to complex, irregular geometries. This paper introduces HFD-PINN, a hybrid framework that bridges this gap by incorporating local FDM stencils into the PINN architecture to leverage numerical "domain knowledge."
Methodology
The core innovation of this work is the replacement of AD with FDM locally within the PINN framework. The authors propose two primary iterations of their hybrid model:
- HFD-PINN (Hybrid Finite Difference PINN): Instead of using AD for the entire domain, this model uses a hybrid strategy. AD is used to handle derivatives at complex boundaries, while FDM is used for the interior regular domains to define the governing equation loss.
- HFD-PINN-sdf: This is the key innovation for irregular geometries. To avoid generating a global background mesh, the authors use a Signed Distance Function (SDF). For any random collocation point, the SDF calculates the distance to the nearest boundary. This distance is used to set a "safe" local difference interval ($\Delta x$), ensuring the FDM stencil points do not fall outside the domain boundary.
By using FDM as a stronger prior, the model receives more "instructive" gradients than pure AD. This helps the optimizer find the correct physical solution faster and with fewer oscillations. The framework effectively creates a "mesh-free" version of FDM, maintaining point-sampling flexibility while gaining numerical precision.
Experimental Results
The framework was evaluated on several classic PDE benchmarks and custom complex geometries, including the viscous Burgers equation and the 2D Poisson equation on "star-shaped" and "flower-like" domains. To demonstrate robustness, the authors tested various high-precision schemes, including the Compact Finite Difference Method (CDM) and the Crank-Nicolson Method (CNM).
Key findings include:
- Superior Accuracy: In complex geometries, HFD-PINN-sdf achieved prediction accuracy 30 to 40 times better than standard AD-PINN.
- Faster Convergence: Loss evolution plots consistently showed that HFD-PINN reached lower error thresholds in fewer iterations. For the Burgers equation, the FD-PINN data loss was nearly an order of magnitude lower than AD-PINN at the same number of collocation points.
- Data Efficiency: HFD-PINN performed significantly better than AD-PINN when the number of collocation points was low, suggesting it is more data-efficient for sparse sampling.
Conclusion and Future Work
HFD-PINN, particularly the HFD-PINN-sdf variant, provides a more instructive and efficient framework for solving PDEs in complex geometries. While calculating FDM stencils for random points adds some computational overhead per iteration, the overall convergence is faster and more accurate. Future research will explore scaling HFD-PINN-sdf to 3D geometries and addressing gradient fluctuations to further stabilize training.
Summary updated