Skip to main content
QUICK REVIEW

[Paper Review] Efficient physics-informed neural networks using hash encoding

Xinquan Huang, Tariq Alkhalifah|arXiv (Cornell University)|Feb 26, 2023
Model Reduction and Neural NetworksPhysics and Astronomy3 citations
TL;DR

This paper proposes a physics-informed neural network (PINN) enhanced with multi-resolution hash encoding to drastically improve training efficiency. By replacing automatic differentiation with finite-difference approximation for derivatives, the method overcomes gradient discontinuities in hash-encoded inputs, achieving up to a 24-fold reduction in training cost across Burgers, Helmholtz, and Navier-Stokes equations.

ABSTRACT

Physics-informed neural networks (PINNs) have attracted a lot of attention in scientific computing as their functional representation of partial differential equation (PDE) solutions offers flexibility and accuracy features. However, their training cost has limited their practical use as a real alternative to classic numerical methods. Thus, we propose to incorporate multi-resolution hash encoding into PINNs to improve the training efficiency, as such encoding offers a locally-aware (at multi resolution) coordinate inputs to the neural network. Borrowed from the neural representation field community (NeRF), we investigate the robustness of calculating the derivatives of such hash encoded neural networks with respect to the input coordinates, which is often needed by the PINN loss terms. We propose to replace the automatic differentiation with finite-difference calculations of the derivatives to address the discontinuous nature of such derivatives. We also share the appropriate ranges for the hash encoding hyperparameters to obtain robust derivatives. We test the proposed method on three problems, including Burgers equation, Helmholtz equation, and Navier-Stokes equation. The proposed method admits about a 10-fold improvement in efficiency over the vanilla PINN implementation.

Motivation & Objective

  • Address the high training cost of conventional PINNs, which limits their practical use in scientific computing.
  • Overcome the low-frequency bias and poor convergence of standard PINNs due to sparse, scalar input representations.
  • Leverage multi-resolution hash encoding to provide locally-aware, multi-scale coordinate representations that improve neural network optimization.
  • Mitigate the non-smooth gradients from hash encoding that hinder automatic differentiation in PINN loss computation.
  • Develop a robust, efficient PINN framework that enables fast, accurate solution of complex PDEs with minimal training time.

Proposed method

  • Integrate multi-resolution hash encoding into the input layer of a PINN to transform scalar coordinates into high-dimensional, locally-aware feature vectors.
  • Use learnable lookup tables for hash vectors at multiple resolution levels to capture fine- and coarse-scale solution features.
  • Replace automatic differentiation with finite-difference approximation for computing derivatives of the network output with respect to input coordinates.
  • Optimize hyperparameters including resolution levels, hash table size, and feature vector dimension to ensure stable and accurate derivative estimation.
  • Apply the method to PDEs with boundary conditions, using a loss function combining data fidelity and PDE residual terms.
  • Use a standard MLP as the network backbone, with the hash-encoded coordinates as input, and train via stochastic gradient descent.

Experimental results

Research questions

  • RQ1Can multi-resolution hash encoding improve the convergence speed of PINNs by enhancing input representation?
  • RQ2How do discontinuities in hash encoding affect the accuracy of automatic differentiation in PINN training?
  • RQ3Can finite-difference approximation of derivatives outperform automatic differentiation in terms of both accuracy and speed for hash-encoded PINNs?
  • RQ4What are the optimal hyperparameter settings for hash encoding that ensure robust derivative computation and fast convergence?
  • RQ5To what extent can hash-encoded PINNs reduce training cost across diverse PDEs like Burgers, Helmholtz, and Navier-Stokes equations?

Key findings

  • The proposed PINN with hash encoding reduces training time by up to 24 times compared to vanilla PINN, with a 10-fold improvement observed in average performance.
  • For the Burgers equation, training cost dropped from 144 seconds to 16.8 seconds, a 10.6x speedup.
  • In the Helmholtz equation, training time decreased from 155 seconds to 21 seconds, a 7.4x improvement.
  • For the Navier-Stokes equation, the training cost was reduced from 640 seconds to 27 seconds, a 23.7x speedup.
  • Finite-difference approximation of derivatives proved more robust and efficient than automatic differentiation when dealing with discontinuous hash-encoded inputs.
  • The method enables semi-instant training for PINNs by improving the loss landscape through better input encoding, reducing reliance on thousands of training epochs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.