ReSDF: Redistancing Implicit Surfaces using Neural Networks
This paper proposes a deep-learning-based method for recovering a signed
distance function (SDF) of a given hypersurface represented by an implicit
level set function. Using the flexibility of constructing a neural network, we
use an augmented network by defining an auxiliary output to represent the
gradient of the SDF. There are three advantages of the augmented network; (i)
the target interface is accurately captured, (ii) the gradient has a unit norm,
and (iii) two outputs are approximated by a single network. Moreover, unlike a
conventional loss term which uses a residual of the eikonal equation, a novel
training objective consisting of three loss terms is designed. The first loss
function enforces a pointwise matching between two outputs of the augmented
network. The second loss function leveraged by a geometric characteristic of
the SDF imposes the shortest path obtained by the gradient. The third loss
function regularizes a singularity of the SDF caused by discontinuities of the
gradient. Numerical results across a wide range of complex and irregular
interfaces in two and three-dimensional domains confirm the effectiveness and
accuracy of the proposed method. We also compare the results of the proposed
method with physics-informed neural networks approaches and the fast marching
method.
Yesom Park, Chang hoon Song, Jooyoung Hahn, Myungjoo Kang
# _ReSDF_: Redistancing Implicit Surfaces using Neural Networks

###### Abstract

This paper proposes a deep-learning-based method for recovering a signed distance function (SDF) of a given hypersurface represented by an implicit level set function. Using the flexibility of constructing a neural network, we use an augmented network by defining an auxiliary output to represent the gradient of the SDF. There are three advantages of the augmented network; (i) the target interface is accurately captured, (ii) the gradient has a unit norm, and (iii) two outputs are approximated by a single network. Moreover, unlike a conventional loss term which uses a residual of the eikonal equation, a novel training objective consisting of three loss terms is designed. The first loss function enforces a pointwise matching between two outputs of the augmented network. The second loss function leveraged by a geometric characteristic of the SDF imposes the shortest path obtained by the gradient. The third loss function regularizes a singularity of the SDF caused by discontinuities of the gradient. Numerical results across a wide range of complex and irregular interfaces in two and three-dimensional domains confirm the effectiveness and accuracy of the proposed method. We also compare the results of the proposed method with physics-informed neural networks approaches and the fast marching method.

keywords: Signed distance function; Level set function; Reinitialization; Deep learning; Eikonal equation +
Footnote †: journal:

## 1 Introduction

The signed distance function (SDF) to a hypersurface \(\Gamma\subset\mathbb{R}^{n}\), which is the distance to \(\Gamma\) in the outer region and the negative of the distance to \(\Gamma\) in the inner region, has been crucial in various fields, ranging from computational fluid dynamics [1; 2; 3] to image segmentation [4; 5; 6], 3D shape reconstruction from scattered point data [7; 8; 9], architectural geometry [10; 11], and robotic navigation [12; 13]. After being devised by Osher and Sethian [14], the level set method, which represents \(\Gamma\) as the zero level set of a continuous function \(\phi:\mathbb{R}^{n}\rightarrow\mathbb{R}\), provides a numerical and theoretical paradigm of evolving hypersurfaces. To facilitate geometric features such as the normal vector and mean curvature of the interface and to reduce numerical instability, the level set function is preferable to be neither too flat nor steep near its zero contours. Reinitializing it as the SDF has been a common numerical treatment in modelling the motion of dynamic interfaces [15; 16; 17; 18] and shape optimization [19; 20; 21; 22].

There have been several numerical methods to re-distance the given level set function \(\phi\). One of the most prominent efforts is built on the fact that the SDF is a solution of partial differential equations (PDEs) [23; 24]. Fast marching methods (FMMs) [25; 26; 27; 28; 29] and fast sweeping methods [30; 31; 32] recover the SDF as a viscosity solution to the eikonal equation. Sussman et al. [33] reformulated the eikonal equation by a pseudo-time-dependent nonlinear hyperbolic PDE. This approach is known to be
more suitable than solving directly the eikonal equation in the case of evolving interfaces. Since the SDF [33] is obtained by the stationary solution, it is time-consuming and requires a large number of iterations depending on the CFL restriction. A more serious issue is that the zero level set fails to be maintained. Lee et al. [34] propose a fast method by using the Hopf-Lax formula of the Hamilton-Jacobi equation. In [35], it is known that the solution of the Hamilton-Jacobi equation in [34] is not exactly the SDF. Another approach [36] employs Varadhan's distance function [37]. By the Hopf-Cole formula, it can be transformed into a regularized eikonal equation with an artificial viscosity term.

Inspired by the tremendous success of deep learning in diverse machine learning tasks, such as image classification [38; 39; 40; 41; 42] and density estimation [43; 44; 45; 46], the use of neural networks for solving PDEs has begun to attract significant attention in recent years. Pioneering studies [47; 48] incorporate physical principles into neural networks by directly constructing a loss function as a residual of PDEs and errors of boundary or initial conditions. Building upon these earlier works, Raissi et al. [49] have revisited them by using modern computational tools and provided a framework named physics-informed neural networks (PINNs). The advantage of PINNs is that they can be readily transformed into various problems [50; 51; 52] and can treat the PDE in a fully mesh-free and time-continuous manner. However, they suffer from a challenging optimization landscape [53; 54], as it is difficult for them to learn many multi-scale or complex PDE systems [55; 56]. Another line of work involves neural operators [57; 58; 59], which unveil physical systems from data by learning implicit solution operator that maps boundary or initial conditions to solutions. They have shown promise in learning complex PDEs [60; 61], but the requirement for large amounts of available data limits application to various of practical problems. In addition, hybrid methods [62; 63; 64; 65] that combine deep learning with well-grounded numerical methods have been studied.

In this paper, we propose a novel method, named _ReSDF_, for reconstructing a SDF from a given implicit level set function \(\phi\) whose zero level set is an interface \(\Gamma\); see Figure 1. By exploiting flexibility of network design and optimization objectives, we compute the SDF through two major ideas. Firstly, inspired by the variable-splitting scheme [66; 67], we introduce an augmented neural network that parametrizes the gradient of the SDF as an auxiliary variable while keeping the number of network parameters. The network is designed so that the approximating SDF accurately distinguishes the interface from the interior and the outer regions and the gradient has a unit norm. Secondly, we propose a training objective consisting of three loss terms. The first loss function comes from the splitting method and it enforces matching vectors between the gradient of the estimated SDF and the auxiliary gradient. The

Figure 1: Concept of the level set reinitialization. The interface \(\Gamma\) is presented by black solid lines. The left is an iso-contour plot of the given level set function \(\phi\) and the right is the iso-contours of the SDF after the reinitialization of \(\phi\).
second loss function imposes a geometric fact that the gradient of the SDF defines the shortest path to the interface. The third loss function is devised to alleviate the nonuniqueness of the gradient caused by multiple shortest paths at a singular point of the SDF. We also provide a theoretical validation of the proposed objectives for reinitializing a level set function. Numerical results confirm that proposed loss functions in conjunction with the designed neural network significantly improve the accuracy compared to the existing PINN approach. The _ReSDF_ also accurately approximates the SDF for the cases of complex and irregular interfaces without tuning sensitive hyper-parameters. The capability of the model is also tested to estimate the distance function on three-dimensional space without increment in the number of parameters of the network.

The rest of the paper is organized as follows. In Section 2, we present the formulation of the problem and a brief discussion about prior works. In Section 3, we introduce the proposed ReSDF by describing the augmented network and the objective function in detail. Numerical experiments are presented in Section 4 to demonstrate the effectiveness and accuracy of ReSDF, followed by some concluding remarks given in Section 5.

## 2 Previous Works

Let \(\Omega\subset\mathbb{R}^{n}\) be a domain and \(\Gamma\subset\Omega\) be a compact hypersurface implicitly represented by a zero level set of a continuous level set function \(\phi:\Omega\rightarrow\mathbb{R}\). The hypersurface \(\Gamma\) divides \(\Omega\) into two disjoint open subsets: the outer region \(\Omega^{+}=\left\{\mathbf{x}\in\Omega\mid\phi\left(\mathbf{x}\right)>0\right\}\) and the inner region \(\Omega^{-}=\left\{\mathbf{x}\in\Omega\mid\phi\left(\mathbf{x}\right)<0\right\}\) satisfying \(\Omega\setminus\Gamma=\Omega^{+}\sqcup\Omega^{-}\). From the given function \(\phi\), the goal is to find the signed distance function (SDF) \(u:\Omega\rightarrow\mathbb{R}\) that satisfies

\[u\left(\mathbf{x}\right)=\begin{cases}d\left(\mathbf{x},\Gamma\right)&\text{ in }\Omega^{+}\\ 0&\text{on }\Gamma\\ -d\left(\mathbf{x},\Gamma\right)&\text{in }\Omega^{-},\end{cases} \tag{1}\]

where \(d\left(\mathbf{x},\Gamma\right)=\min\limits_{\mathbf{y}\in\Gamma}\parallel \mathbf{x}-\mathbf{y}\parallel\) denotes the standard Euclidean distance function to \(\Gamma\). It is a unique viscosity solution to the eikonal equation [68]

\[\parallel\nabla u\parallel =1, \tag{2}\] \[\operatorname{sgn}\left(u\right) =\operatorname{sgn}\left(\phi\right), \tag{3}\]

where \(\phi\) is the given level set function and \(\operatorname{sgn}\) is the signum function, which takes either \(1\), \(0\), or \(-1\) for points in \(\Omega^{+}\), \(\Gamma\), or \(\Omega^{-}\), respectively.

The variational approaches to approximate the distance function (2) in [69; 70; 71] are to minimize the energy functional related to the eikonal equation:

\[\mathcal{E}\left(u\right)=\int_{\Omega}\left(\left\|\nabla u\right\|-1\right)^ {2} \tag{4}\]

in conjunction with the Dirichlet boundary condition \(u\left(\Gamma\right)=0\) as a constraint relaxed by a penalty term:

\[\min\limits_{u}\,\mathcal{E}\left(u\right)+\int_{\Gamma}\left|u\right|. \tag{5}\]

Several efforts have also been made to improve the ill-posedness or convergence of the variational problem (4), including penality methods introducing external energy functionals for shifting the zero level set toward the target interface [6] and for preserving the shape of the free interface [72], and effective splitting schemes [36; 73] using alternating direction method of multipliers [74].
As neural PDE surrogates have proliferated as an impactful area of research, several efforts have been made to reconstruct the SDF using neural networks. Prior studies mostly resort to the steady eikonal equation to find the SDF. Lichtenstein et al. [75] propose a hybrid method that integrates neural networks into the FMM [25]. They replace the local numerical solver in the FMM with a neural network trained from data. The accuracy of the numerical solution is improved by leveraging the expressive power of neural networks. Since the approach requires a wealth of training data with true distance values, it might be difficult to be used in application where lots of true distances are hard to obtain. The performance relies on the amount of available data and would be unfavourable outside of the data on which the network is trained. Another approach directly uses a neural network to parametrize the SDF. Gropp et al. [8] adopt the PINN approach to learn the SDF from an unorganized cloud of points. They directly use a neural network to parametrize the SDF of the given point cloud by minimizing the eikonal-embedded loss function.

Recent works [76; 77] leverage a framework of PINN [49]. Similar to the variational approaches (4), they convert the problem of solving the eikonal equation (2) into an optimization problem in which the loss function embeds the knowledge of (2):

\[\mathcal{L}_{Eik}\left(\theta\right)=\frac{1}{\mid\mathcal{D}\mid}\sum_{ \mathbf{x}\in\mathcal{D}}\Bigl{(}\|\nabla u_{\theta}\left(\mathbf{x}\right) \|-1\Bigr{)}^{2}+\lambda\mathcal{L}_{R}\left(\theta\right), \tag{6}\]

where \(u_{\theta}\) is a neural network parametrized by \(\theta\), which is an approximator of the solution to (2). The soft penalty term \(\mathcal{L}_{R}\) enforces an additional constraint on the solution such as weight normalization or boundary conditions. The expectation is taken with respect to a collection \(\mathcal{D}\) of scattered collocation points usually chosen by uniform random sampling. The objective of the residual of the eikonal equation characterizes the deviation of \(u_{\theta}\) from the SDF. The trained network \(u_{\theta}\left(\mathbf{x}\right)\) serves as a suitable approximation of the solution. Fayolle [76] also suggests an alternative PINN-based approach that relies on \(p\)-Poisson distances [78]. As discussed in the numerical section, we compare the proposed method with the results of the PINN-based approach for irregular and complex interfaces and check the robustness of using various initial level set functions \(\phi\).

## 3 Proposed Method

In this section, we propose a learning-based approach to recover the SDF (_ReSDF_) of a given hypersurface implicitly represented by a level set function. In order to increase the expressiveness of the network we use an augmented network that parameterizes the gradient of SDF as an auxiliary output while keeping the number of parameters. Moreoever, novel objectives are designed to exploit a global property and alleviate a singularity of the SDF by harnessing the geometric properties of the SDF.

### Augmented Network Representation

In this section, inspired by variable-splitting methods [66; 67] in optimization, an augmented network structure is considered to separately parametrize the gradient of the SDF as an auxiliary variable. The augmented network has two outputs that satisfy the following characteristics: (i) the primary output \(u_{\theta}\) approximates the SDF and it automatically vanishes on the interface as well as satisfies the sign condition (3) and (ii) the gradient field represented by the auxiliary output \(V_{\theta}\) has a unit norm; see Figure 2.

We parameterize a single network \(N_{\theta}:\mathbb{R}^{n}\rightarrow\mathbb{R}\times\mathbb{R}^{n}\) to output \(\psi_{\theta}\left(\mathbf{x}\right)\in\mathbb{R}\) together with an auxiliary value \(\Psi_{\theta}\left(\mathbf{x}\right)\in\mathbb{R}^{n}\)

\[N_{\theta}\left(\mathbf{x}\right)=\Bigl{(}\psi_{\theta}\left(\mathbf{x} \right),\Psi_{\theta}\left(\mathbf{x}\right)\Bigr{)}. \tag{7}\]

because it is more efficient to approximate the SDF and its gradient using a single common network rather than learning with two individual networks. The first scalar function \(\psi_{\theta}\) and the other vector-valued
component \(\Psi_{\theta}\) are employed to parametrize \(u_{\theta}\) and \(V_{\theta}\), respectively, through a designed architecture in Figure 2. The neural perceptron \(\tilde{\Psi}_{\theta}\) is defined using a multi-layer fully-connected neural network:

\[\tilde{\Psi}_{\theta}\left(\mathbf{x}\right)=W\left(f_{L}\circ\cdots\circ f_{0} \left(\mathbf{x}\right)\right)+\mathbf{b},\ \mathbf{x}\in\mathbb{R}^{n},\]

where \(L\in\mathbb{N}\) is a given depth, \(W\in\mathbb{R}^{n+1\times d_{L}}\) is a weight of the output layer, \(\mathbf{b}\in\mathbb{R}^{n+1}\) is a final bias vector and the perceptron (also known as the hidden layer) \(f_{\ell}:\mathbb{R}^{d_{\ell-1}}\rightarrow\mathbb{R}^{d_{\ell}}\) is defined by

\[f_{\ell}\left(\mathbf{y}\right)=\sigma\left(W_{\ell}\mathbf{y}+\mathbf{b}_{ \ell}\right),\ \mathbf{y}\in\mathbb{R}^{d_{\ell-1}},\text{ for all }\ell=0,\ldots,L,\]

for \(W_{\ell}\in\mathbb{R}^{d_{\ell}\times d_{\ell-1}}\), \(\mathbf{b}_{\ell}\in\mathbb{R}^{d_{\ell}}\), and a non-linear activation function \(\sigma\). The dimensions \(d_{\ell}\) of the hidden layers are also called by the width of the network. As the input to the network is a point \(\mathbf{x}\) in \(\Omega\), the input dimension of the input layer \(f_{0}\) is \(d_{0}=n\). The output layer recovers the \((n+1)\)-dimensional output values using the matrix product between the output of the final hidden layer \(f_{L}\) and \(W\) in addition to a bias vector \(\mathbf{b}\). A shorthand notation \(\theta\) is used for all parameters in the weights \(\{W,W_{0},\cdots,W_{L}\}\) and biases \(\{\mathbf{b},\mathbf{b}_{0},\cdots,\mathbf{b}_{L}\}\). Given the current parameter configuration, the parameters \(\theta\) are successively adapted by minimizing an assigned loss function explained in Section 3.2.

Representation of SDFWe aim to adjust the network output \(\psi_{\theta}\) so that the approximated SDF satisfies the sign condition (3). Thanks to the level set representation, the sign of the SDF is easily obtained. Similar to [76], we treat the condition on the sign of the SDF as a hard constraint by parameterizing the primary output as

\[u\left(\mathbf{x}\right)\approx u_{\theta}\left(\mathbf{x}\right)\coloneqq \mathcal{S}\left(\phi\left(\mathbf{x}\right)\right)\left|\psi_{\theta}\left( \mathbf{x}\right)\right|, \tag{8}\]

where the quantity \(\mathcal{S}\left(\phi\left(\mathbf{x}\right)\right)\) is a smoothed sign function of \(\phi\left(\mathbf{x}\right)\):

\[\mathcal{S}\left(y\right)=\gamma\tanh\left(\beta y\right),\ y\in\mathbb{R}\]

with a scaling factor \(\gamma=1.4\approx 1/\tanh 1\) and a smoothing parameter \(\beta=70\) are fixed in all examples. Clearly, the designed artificial neural network as an ansatz of the SDF automatically brings the sign condition, \(\operatorname{sgn}\left(u_{\theta}\right)=\operatorname{sgn}\left(\phi\right)\). In particular, \(u_{\theta}\) vanishes on the target interface \(\Gamma\). Therefore, the zero-level set of the approximated SDF can accurately preserve the interface without smearing out.

Figure 2: The _ReSDF_ model architecture is visualized. The input \((x,y)\) passes through the shared shallow fully-connected network on the shaded region. The _ReSDF_ parametrizes \(u_{\theta}=\operatorname{sgn}\left(\phi\right)\psi\) as an ansatz of the SDF together with the auxiliary output \(V_{\theta}=\Psi/\mid\Psi\mid\) which approximates the gradient of the SDF.
Approximation of the gradient fieldIn contrast to the existing approaches, which treat the unit norm property of the gradient as a soft constraint, we design the augmented output

\[\nabla u\left(\mathbf{x}\right)\approx V_{\theta}\left(\mathbf{x}\right):\mathbb{R }^{n}\to S^{n-1}\]

to automatically satisfy the unit norm constraint. To this end, we define a neural network that lies in the unit sphere \(S^{n-1}\) by normalizing the auxiliary output \(\Psi\):

\[V_{\theta}\left(\mathbf{x}\right)\coloneqq\frac{\Psi_{\theta}\left(\mathbf{x} \right)}{\mid\Psi_{\theta}\left(\mathbf{x}\right)\mid}. \tag{9}\]

In other words, \(\Psi_{\theta}\) learns only the direction of the gradient of SDF and it is automatically adjusted to the unit length by normalization.

To sum up, the SDF and its gradient are estimated from the output of the augmented network (7) as

\[u\left(\mathbf{x}\right)\approx u_{\theta}\left(\mathbf{x}\right) \coloneqq\mathcal{S}\left(\phi\left(\mathbf{x}\right)\right)\left| \psi_{\theta}\left(\mathbf{x}\right)\right|, \tag{10}\] \[\nabla u\left(\mathbf{x}\right)\approx V_{\theta}\left(\mathbf{x}\right) \coloneqq\frac{\Psi_{\theta}\left(\mathbf{x}\right)}{\mid\Psi_{ \theta}\left(\mathbf{x}\right)\mid}. \tag{11}\]

The resultant \(u_{\theta}\) vanishes on \(\Gamma\) and \(V_{\theta}\) has unit length. Moreover, it is worth emphasizing that \(u_{\theta}\) and \(V_{\theta}\) share the same weights and biases from the input layer till the last hidden layer. This enables a reduction in the number of parameters and faster training than using two separate networks.

### Design of loss functions

A formulation of the loss function is another key ingredient to achieve effective learning using two outputs of the augmented networks (7). In this section, we explain the following objective function consisting of three loss terms:

\[\mathcal{L}(u,V)=\int_{\Omega}\left\|\nabla u\left(\mathbf{x}\right)-V\left( \mathbf{x}\right)\right\|^{2}+\int_{\Omega}\left|\phi\left(\mathbf{x}-u\left( \mathbf{x}\right)V\left(\mathbf{x}\right)\right)\right|^{2}+\int_{\Omega} \left\|V\left(\mathbf{x}\right)-V\left(\mathbf{x}-\eta u\left(\mathbf{x} \right)V\left(\mathbf{x}\right)\right)\right\|^{2}, \tag{12}\]

where \(\eta>0\) is a fixed constant. The main characteristics are summarized:

* The first term enforces the vector matching between the gradient of the primary output and the auxiliary output.
* The second term imposes a global property using the fact that the SDF and its gradient determine the shortest path to the interface.
* The third term alleviates a singularity where the SDF is not differentiable.

In A, it is proved that the SDF is a minimizer of the functional \(\mathcal{L}(u,V)\). The Euler-Lagrange equation for the functional \(\mathcal{L}(u,V)\) is nonlinear and it is not straightforward to find a minimizer by conventional methods. It highlights one of the main advantages of the deep learning approach to minimize such a complex loss function.

Gradient matching objectiveThe gradient matching (GM) objective directly enforces to reduce a gap between the gradient of the primary output \(u_{\theta}\) and the unit-norm auxiliary output \(V_{\theta}\) in (7):

\[\mathcal{L}_{\text{GM}}\left(\theta\right)=\frac{1}{\mid\mathcal{D}\mid}\sum _{\mathbf{x}\in\mathcal{D}}\left\|\nabla u_{\theta}\left(\mathbf{x}\right)-V _{\theta}\left(\mathbf{x}\right)\right\|^{2}. \tag{13}\]
The gradient of \(u_{\theta}\) in (13) by auto-differentiation library (autograd) [79] calculates the exact derivatives of the networks. In the view of the variable-splitting method, the variational problem (5) is reformulated by

\[\min_{u,\;V}\int_{\Gamma}\left|u\right|+\int_{\Omega}\left(\left\|V\right\|-1 \right)^{2},\;\text{subject to }\nabla u=V.\]

By regularizing the constraint as a penalty term, an unconstrained problem is presented:

\[\min_{u,\;V}\int_{\Gamma}\left|u\right|+\int_{\Omega}\left(\left\|V\right\|-1 \right)^{2}+\lambda\int_{\Omega}\left\|\nabla u-V\right\|^{2}, \tag{14}\]

where \(\lambda>0\) is a regularization parameter. Since \(u_{\theta}\) automatically vanishes on \(\Gamma\) in the proposed network structure in Section 3.1, the first loss term in (14) is no longer needed. The network structure in which the \(V_{\theta}\) is designed to have a unit norm allows us to exclude the second term in (14). This leads us to consider \(\mathcal{L}_{\text{GM}}\) (13). Since the existing PINN methods are used to learn the eikonal equation with a single network output, the network must learn the direction of the gradient while matching its norm to be one. In the matching loss function (13), \(\Psi_{\theta}\) learns the direction of the gradient of the SDF and \(\nabla u_{\theta}\) is matched pointwise to the normalized vector \(V_{\theta}\) of \(\Psi_{\theta}\).

Shortest path objectiveThe shortest path (SP) objective explains how the gradient of SDF makes the shortest path to the interface \(\Gamma\):

\[\mathcal{L}_{\text{SP}}\left(\theta\right)=\frac{1}{\mid\mathcal{D}\mid}\sum _{\mathbf{x}\in\mathcal{D}}\left|\phi\left(\mathbf{x}-u_{\theta}\left(\mathbf{ x}\right)V_{\theta}\left(\mathbf{x}\right)\right)\right|^{2}. \tag{15}\]

The loss function \(\mathcal{L}_{\text{SP}}\) specifies a relations between the interface \(\Gamma\) and the points away from \(\Gamma\) by using the gradient of the SDF. The following proposition delivers a justification of using (15) in the view of geometric property of the SDF.

**Proposition 1**.: _[_80, 81_]_ _Let \(\Gamma\subset\Omega\) be a compact hypersurface of a domain \(\Omega\subset\mathbb{R}^{n}\). Suppose \(u:\Omega\rightarrow\mathbb{R}\) is the signed distance function to \(\Gamma\). Then, \(u\) is differentiable except on a set of zero measure. Moreover, for any point \(\mathbf{x}\in\Omega\) where \(u\left(\mathbf{x}\right)\) is differentiable, it satisfies_

\[\mathbf{x}_{\Gamma}=\mathbf{x}-u\left(\mathbf{x}\right)\nabla u\left(\mathbf{ x}\right)\in\Gamma, \tag{16}\]

_where \(\mathbf{x}_{\Gamma}=\arg\min_{\mathbf{y}\in\Gamma}d(\mathbf{x},\Gamma)\)._

The property (16) describes the shortest path of a point \(\mathbf{x}\) to the target interface. The shortest path explains that a point \(\mathbf{x}\in\Omega\) came from a point on the interface \(\mathbf{x}_{\Gamma}=\arg\min_{\mathbf{y}\in\Gamma}d(\mathbf{x},\Gamma)\), that is, the closest point to \(\mathbf{x}\) on \(\Gamma\). Note that \(\mathcal{L}_{\text{GM}}\) (13) matches a local relation between the gradient of \(u_{\theta}\) and \(V_{\theta}\) pointwisely. On the other hand, the shortest path loss function \(\mathcal{L}_{\text{SP}}\) dictates non-local relation between points and directly enforces \(u_{\theta}\) to satisfy the geometric property along with \(V_{\theta}\). With a help of a given function \(\phi\) whose zero level set represents \(\Gamma\), we have

\[\mathbf{x}-u\left(\mathbf{x}\right)\nabla u\left(\mathbf{x}\right)\in\Gamma \iff\phi\left(\mathbf{x}-u\left(\mathbf{x}\right)\nabla u\left(\mathbf{x} \right)\right)=0, \tag{17}\]

then \(\left|\phi\left(\mathbf{x}-u_{\theta}\left(\mathbf{x}\right)\nabla u_{\theta} \left(\mathbf{x}\right)\right)\right|\) in the loss function (15) is a reasonable choice and train it to approach zero. Note that this loss function requires the derivative of \(u_{\theta}\) with respect to the spatial variable \(\mathbf{x}\) and the computed gradient is multiplied by \(u_{\theta}\) again. It is a challenging optimization because the gradient calculation is deep and the loss landscape is complex. However, as we have \(V_{\theta}\) as an approximation of the gradient of the SDF, we replace \(\nabla u_{\theta}\) with \(V_{\theta}\) in (17). By replacing \(\nabla u_{\theta}\) with \(V_{\theta}\), the chain rule for computing the gradients of the objective (15) is simpler than using \(\nabla u_{\theta}\).
_Regularizing singularity objective_. The regularizing singularity (RS) objective resolves a singularity of the SDF:

\[\mathcal{L}_{\mathrm{RS}}\left(\theta\right)=\frac{1}{\mid\mathcal{D}\mid}\sum_{ \mathbf{x}\in\mathcal{D}}\left\|V_{\theta}\left(\mathbf{x}\right)-V_{\theta} \left(\mathbf{x}-\eta u_{\theta}\left(\mathbf{x}\right)V_{\theta}\left(\mathbf{ x}\right)\right)\right\|^{2}, \tag{18}\]

where \(\eta>0\). At a singular point \(\mathbf{x}\in\Omega\), since there are multiple closest points \(\mathbf{x}_{\Gamma}\) (16) on the interface, the gradient of the SDF at \(\mathbf{x}\) is not unique. In (18), we detour the singularity of the SDF by defining \(V_{\theta}\left(\mathbf{x}\right)\) at a singular point \(\mathbf{x}\) as a reliable gradient value near the interface \(V_{\theta}\left(\mathbf{x}-t\nabla u_{\theta}\left(\mathbf{x}\right)\right)\) for some \(t\). The idea is supported by the following proposition.

**Proposition 2**.: _Let \(\Gamma\subset\Omega\) be a compact hypersurface of a domain \(\Omega\subset\mathbb{R}^{n}\) and \(u:\Omega\rightarrow\mathbb{R}\) the signed distance function to \(\Gamma\). For any point \(\mathbf{x}\in\Omega\) where \(u\) is differentiable, the gradient of \(u\) is constant along the ray \(s\left(t\right)\) emanating from \(\mathbf{x}\) in direction \(\nabla u\left(\mathbf{x}\right)\):_

\[s\left(t\right)=\mathbf{x}-tsgn\left(u\left(\mathbf{x}\right)\right)\nabla u \left(\mathbf{x}\right),\ \forall\ t\in\left[0,\left|u\left(\mathbf{x}\right)\right|\right).\]

The proof is provided in B. In practice, as in \(\mathcal{L}_{\mathrm{SP}}\), we replace \(\nabla u_{\theta}\) with \(V_{\theta}\) and we set \(\eta=0.99\) so that the point gets close to the target interface having reliable gradient value. The loss function \(\mathcal{L}_{\mathrm{RS}}\) enables accurate and stable training of \(V_{\theta}\) and provides an appropriate approximation of SDF for various irregular interfaces.

To sum up, the proposed _ReSDF_ optimizes the augmented network through the objective

\[\mathcal{L}_{\mathrm{total}}\left(\theta\right)=\mathcal{L}_{\mathrm{GM}}\left( \theta\right)+\mathcal{L}_{\mathrm{SP}}\left(\theta\right)+\mathcal{L}_{\mathrm{ RS}}\left(\theta\right). \tag{19}\]

It can be extended to the weighted sum of each loss term where the positive regularization parameters balance the role of each. We may impose a larger weight on the larger component to accelerate its convergence. A more provable alternative to hand-tuned weights is the use of adaptive regularization parameter methods [82; 53; 83]. However, in contrast to most PINN methods, which are sensitive to the regularization parameter, we experimentally confirm that the objective (19) is transferable across a wide variety of interfaces \(\Gamma\) and level set functions \(\phi\).

### Numerical Considerations

There are a few numerical considerations to clarify the implementation of the proposed method. In order to minimize biased training of the neural network proportional to the values of \(\phi\), we consider the following normalization of \(\phi\)

\[\phi_{\mathrm{normalized}}\left(\mathbf{x}\right)=\frac{\phi\left(\mathbf{x} \right)}{\sqrt{\max_{\Omega}\left(\phi\right)\max_{\Omega}\left(-\phi\right)}},\]

where the maximum is computed over points in \(\Omega\). The values of \(\phi\) over the entire computational domain \(\Omega\) are balanced in the objective \(\mathcal{L}_{\mathrm{SP}}\) and the normalization alleviates the imbalance of \(\phi\) and enables the model to recover the SDF well from the strongly distorted level set function \(\phi\). To remove a singularity caused by the absolute value function in (8), we use a smooth approximation. For a point \(x_{0}\) at which \(\mathcal{S}^{\prime}\left(x_{0}\right)=0.6\max_{x}\mathcal{S}^{\prime}\left(x\right)\), we define a quadratic approximation

\[ABS_{\infty}\left(x\right)\coloneqq\begin{cases}\alpha x^{2},&\text{if}\ \left|x\right|\leq x_{0}\\ \left|x\right|+q,&\text{if}\ \left|x\right|>x_{0},\end{cases}\]

where \(\alpha\) is chosen such that \(\left(\mathcal{S}\cdot ABS_{\infty}\right)^{\prime}\left(x_{0}\right)=1\), and \(q\) is taken so that \(ABS_{\infty}\) is continuous at \(x_{0}\). Moreover, we adopt the leaky rectified linear unit (LeakyReLU) activation function:

\[\text{LeakyReLU}\left(x\right)=\begin{cases}x&\text{if}\ x\geq 0,\\ 0.01x&\text{otherwise},\end{cases}\]
which is possibly a good representation for a non-smooth function.

The second term of the loss functions \(\mathcal{L}_{\text{RS}}\) has a complex form in which the network is composited within the network. It causes practical difficulties in optimization when the loss function has a stacked network. In the implementation, we optimize \(\mathcal{L}_{\text{RS}}\) as follows:

\[\mathcal{L}_{\text{RS}}\left(\theta\right)=\frac{1}{\mid\mathcal{D}\mid}\sum_ {\mathbf{x}\in\mathcal{D}}\left\|V_{\theta}\left(\mathbf{x}\right)-V_{\hat{ \theta}}\left(\mathbf{x}-\eta u_{\theta}\left(\mathbf{x}\right)V_{\theta} \left(\mathbf{x}\right)\right)\right\|^{2},\]

where we do not update the network \(V_{\hat{\theta}}\) by disabling the gradient calculation of \(V_{\hat{\theta}}\). Then, the computational graph is no longer associated with the parameters of \(V_{\hat{\theta}}\) and it is regarded as a fixed function in the loss function.

The SDF is Lipschitz continuous with the Lipschitz constant \(1\). In the multilayer perceptron structure approximating \(u_{\theta}\), the activation function and weights \(W_{\ell}\) determine the Lipschitz condition of the approximated SDF. Since we are using LeakyReLU whose Lipschitz conatant is \(1\) as an activation function, we can obtain the desired condition by adjusting the weights. The commonly used method to enforce the Lipschitz condition is _weight clipping_[84]. It clamps the weights \(W_{\ell}\) to a bounded box \(W_{\ell}\in\left[-M,M\right]^{d_{\ell}\times d_{\ell-1}}\) after each gradient update. In the implementation, the clipping parameter \(M=0.1\) is used.

## 4 Numerical Results

In this section, we present numerical results of _ReSDF_ on several problems to validate the effectiveness and accuracy for re-distancing the given level set functions. For quantitative measurements, the accuracy of the trained model is measured by the difference with the exact solution \(u\) and exact gradient \(\mathbf{n}\) using the following norms:

\[\left\|u_{\theta}-u\right\|_{L^{2}} =\frac{1}{\left|\Omega\right|}\left(\int_{\Omega}\left|u_{\theta }\left(\mathbf{x}\right)-u\left(\mathbf{x}\right)\right|^{2}d\mathbf{x} \right)^{1/2},\quad\left\|u_{\theta}-u\right\|_{L^{\infty}}=\max_{\mathbf{x} \in\Omega}\left|u_{\theta}\left(\mathbf{x}\right)-u\left(\mathbf{x}\right) \right|, \tag{20}\] \[\left\|V_{\theta}-\mathbf{n}\right\|_{L^{2}} =\frac{1}{\left|\Omega\right|}\left(\int_{\Omega}\left|V_{ \theta}\left(\mathbf{x}\right)-\mathbf{n}\left(\mathbf{x}\right)\right|^{2}ds \right)^{1/2},\quad\left\|V_{\theta}-\mathbf{n}\right\|_{L^{\infty}}=\max_{ \mathbf{x}\in\Omega}\left|V_{\theta}\left(\mathbf{x}\right)-\mathbf{n}\left( \mathbf{x}\right)\right|,\]

where \(\left|\Omega\right|\) is the volume of the computational domain \(\Omega\). Since the errors on the interface \(\Gamma\) are crucial for the cases of evolving the interface, we also check the errors, \(\left\|V_{\theta}-\mathbf{n}\right\|_{L^{2}}^{\Gamma}\) and \(\left\|V_{\theta}-\mathbf{n}\right\|_{L^{\infty}}^{\Gamma}\), which are only measured on the interface \(\Gamma\) for a few examples. For qualitative comparison, the results of _ReSDF_ are compared with the existing PINN approach and the first [25] and second-order [85] fast marching method (FMM), where implementation builds on an open-source code 1. The PINN method based on [76] uses the residual of the eikonal equation (6) as the loss function. As suggested in [76], a fully connected network with depth \(8\) and width \(512\) with skip connection from the input and the fourth hidden layer are used in which all weights and biases are initialized by the geometric initialization scheme [86]. We optimize the network by Adam optimizer [87] with learning rate of \(10^{-4}\). We also comply with all other experimental configurations as provided in [76]. Note that the results of the PINN approach can be improved because the performance relies on specific geometric network parameter initialization [86] and is sensitive to hyper-parameter selection.

Footnote 1: [https://github.com/scikit-fmm/scikit-fmm](https://github.com/scikit-fmm/scikit-fmm)

For all examples of testing _ReSDF_, the Adam optimizer is applied with a learning rate of \(10^{-3}\), which decayed by \(0.9\) if the loss function does not improve after \(30\) evaluations. We evaluate the models per \(100\) epochs and trained them until the learning rate decayed by \(40\) times. In all numerical experiments, a single NVIDIA RTX 3090 GPU is used.
Figure 3: The graph (left) and iso-contours (right) of level set functions, a stiff shape \(\phi_{1}\) (23), an oscillatory shape \(\phi_{2}\) (25), and a discontinuous shape \(\phi_{3}\) (24) are presented.
The computational domains of all examples are \(\Omega^{\text{3d}}=\left[-1.1\right]^{3}\) or \(\Omega=\Omega^{\text{3d}}\cap\left(\mathbb{R}^{2}\times\left\{0\right\}\right)\). The collocation points evenly distributed on the domain \(\Omega^{\text{3D}}\) are presented by

\[\Omega_{n}^{\text{3d}}=\left\{\left(-1+ih,-1+jh,-1+kh\right):i,j,k\in\left\{0, \ldots,n-1\right\},\,h=\frac{2}{n-1}\right\}. \tag{21}\]

Accordingly, \(\Omega_{n}=\Omega_{n}^{\text{3d}}\cap\left(\mathbb{R}^{2}\times\left\{0\right\}\right)\). All interfaces and given level set functions used in numerical examples are listed below. In case of the closed form of the exact SDF is not known for given interfaces, we approximate it by creating a finite number of points, around 7000, on the interface and finding the minimum Euclidean distance from them.

1. A circle centered at the origin with the radius \(r=\frac{1}{2}\) is used in Example 1. The explicit form of the exact SDF is an equation of the cone: \[u\left(x,y\right)=\sqrt{x^{2}+y^{2}}-r.\] (22) Three level set functions are considered in Example 1: * An unbalanced function that is relatively flat and stiff on \(\Omega^{-}\) and \(\Omega^{+}\), respectively; see Figure 3-(a): \[\phi_{1}\left(x,y\right)=e^{x+y}u(x,y).\] (23) * A rapidly oscillating non-monotone function; see Figure 3-(b): \[\phi_{2}\left(x,y\right)=\begin{cases}x^{2}+\frac{3}{2}y^{2}&\text{ if }u(x,y)>0,\\ (u(x,y)-r_{0})^{2}-r_{0}^{2}&\text{ otherwise }.\end{cases}\] (24) * A discontinuous function with a jump on the interface; see Figure 3-(c): \[\phi_{3}\left(x,y\right)=\left(1.2\sin\left(4\pi x\right)\sin\left(4\pi y \right)+2\right)e^{-\left(x^{2}+y^{2}\right)/2}u(x,y).\] (25)
2. A square centered at the origin with the length of the side \(r=1\) is used in Example 2. The level set function whose zero level is the square is given; see the coutours in Figure 5-(a): \[\phi_{4}\left(x,y\right)=\frac{1}{2}\max\left\{\mid x\mid-\frac{r}{2},\mid y \mid-\frac{r}{2}\right\}.\] (26)
3. Flower-shaped interfaces with five-fold symmetry represented by the zero level set of the level set function with the polar coordinates \(\left(r,\theta\right)\) are used in Example 3; see the iso-contours in Figures 6-(a) and (b): \[\phi_{5}^{\alpha}\left(x,y\right)=\left(0.5\sin\left(6\pi x\right)\sin\left(6 \pi y\right)+1\right)\left(5r-2-\alpha\cos\left(5\theta\right)\right),\] (27) where \(\alpha=0.5\) and \(1\).
4. A dumbbell-shaped interface represented by the zero level set of the level set function is used in Example 3; see the iso-contours in Figure 6-(c): \[\phi_{6}\left(x,y\right)=10x^{4}\left(2x^{2}-1\right)+y^{2}-\frac{1}{10}.\] (28)
5. A heart-shaped interface represented by the zero level set of the level set function is used in Example 3; see the coutours in Figure 6-(d): \[\phi_{7}\left(x,y\right)=\left(\cos\left(x,y\right)+2\left(x+y\right)^{2}+\frac{ 3}{2}\right)\left(2.2\left(y+0.2-x^{\frac{2}{3}}\right)^{2}+1.7x^{2}-0.6\right).\] (29)
6. Multiple circular interfaces represented by the zero level set of minimum of the level set functions \(u_{j}\left(x,y\right)=(x-x_{j})^{2}+(y-y_{j})^{2}-r_{j}^{2}\) are used in Example 4: \[\phi_{8}\left(x,y\right) =e^{x+y}\min_{x,y}\left\{u_{j}(x,y):j=1,2\right\},\] (30) \[\phi_{9}\left(x,y\right) =e^{x+y}\min_{x,y}\left\{u_{j}(x,y):j=3,4,5\right\},\] (31) where \((x_{1},y_{1},r_{1})=(-0.2,0,0.3)\), \((x_{2},y_{2},r_{2})=(-0.2,0,0.3)\), \((x_{3},y_{3},r_{3})=(-0.4,0.3,0.45)\), \((x_{4},y_{4},r_{4})=(0.5,0.3,0.3)\), and \((x_{5},y_{5},r_{5})=(0.3,-0.5,0.4)\); see the iso-contours in Figures 10-(a) and (c).
7. A sphere centered at the origin with the radius \(r=\frac{1}{2}\) is represented by the zero level set of the level set function used in Example 5; see the coutours on \(z=0\) in Figure 11-(a): \[\phi_{10}\left(x,y,z\right)=\left(\left(x-1\right)^{2}+\left(y-1\right)^{2}+ \left(z+1\right)^{2}+0.1\right)\left(x^{2}+y^{2}+z^{2}-r^{2}\right).\] (32) Multiple ellipsoidal interfaces represented by the zero level set of minimum of the level set functions \(v_{j}(x,y,z)=10(x-x_{j})^{2}+5(y-y_{j})^{2}+(z-z_{j})^{2}-1\) are used in Example 5; see the iso-contours on \(z=0\) in Figure 11-(c): \[\phi_{11}\left(x,y,z\right)=\min_{x,y,z}\left\{v_{j}(x,y,z):j=1,2\right\},\] (33) where \((x_{1},y_{1},z_{1})=(-0.2,0,0)\) and \((x_{2},y_{2},z_{2})=(0.2,0,0)\).
significantly with different batch sizes of training collocation points. Even with a coarse grid, we still obtain accurate predictions. We can also observe that the resulting errors decrease as the network width size increases. This is a general phenomenon in which the expressive power increases as the size of the network increases.

The robustness of changing the level set functions is examined by using diverse initial level set functions; a stiff shape \(\phi_{1}\) (23), an oscillatory shape \(\phi_{2}\) (25), and a discontinuous shape \(\phi_{3}\) (24). In this case, the model is trained with a fixed width of size 64 on collocation points \(\Omega_{7}\). The results are compared with that of the PINN approach. The accuracy of two models is listed in Table 3. The results of _ReSDF_ have a smaller error than the results of the PINN approach by a factor of \(10^{-3}\) and \(10^{-2}\) in the \(L^{2}\) and \(L^{\infty}\) norms, respectively. In order to present visual differences, we compare the predictions of the trained _ReSDF_ and PINN against the exact SDF in Figure 4. It shows a similar result with \(\phi_{1}\). However, the PINN approach fails to predict SDF with \(\phi_{2}\) and \(\phi_{3}\).
Figure 4: The iso-contours of the results of _ReSDF_ (left) and PINN approach (right) from three level set functions, a stiff shape \(\phi_{1}\) (23), an oscillatory shape \(\phi_{2}\) (25), and a discontinuous shape \(\phi_{3}\) (24) are presented with the exact solution. The red solid curve is the zero level set of mentioned level set functions.
to see how good numerical solution it is, we compare the results with the second order FMM (FMM\({}^{2}\)) in Table 4. The \(L^{2}\) errors of the SDF and its gradient predicted by _ReSDF_ on \(\Omega_{6}\) are between the \(L^{2}\) errors of the result of FMM\({}^{2}\) on \(\Omega_{6}\) and \(\Omega_{8}\). It means that the accuracy of _ReSDF_ on a small number of collocation points is comparable to FMM\({}^{2}\) on a large number of collocation points and it is consistent with previous findings in Example 1.

Example 3: To demonstrate that the proposed model can be applied to various interfaces, the level set functions, \(\phi_{5}^{\alpha}\) (27) with \(\alpha=0.5\) and \(1\), \(\phi_{6}\) (28), and \(\phi_{7}\) (29), are used to be reinitialized; see in Figure 6. Due to the rapid change of the gradient field of the level set functions \(\phi_{5}^{1}\) and \(\phi_{6}\), the clipping parameter \(M=5\) is used to improve the representability of \(V_{\theta}\). Other parameters are consistent with other cases.

Throughout the examples in Figure 7, the results are compared with the existing PINN approach. The numerical results verify that the proposed method has better agreement with the exact SDF than PINN approach which is prone to returning erroneous predictions for chosen irregular interfaces. Furthermore, the result of _ReSDF_ with the level set function \(\phi_{7}\) 29 on \(\Omega_{6}\) is qualitatively compared with the results of FMM and FMM\({}^{2}\) on \(\Omega_{n}\), \(n=6,\ldots,9\) in Figures 8 and 9, respectively. In the neural network of _ReSDF_, we use the width 128 and depth 4. Since the batch size is small to \(\Omega_{6}\), the learning rate is initialized by \(5\cdot 10^{-4}\). FMM produces reliable results when the mesh is sufficiently refined. Comparing the results in Figure 8, the result of the first-order FMM on \(\Omega_{9}\) is similar to the result of _ReSDF_ trained on the collocation points \(\Omega_{6}\). Similarly, in Figure 9, the result of _ReSDF_ on \(\Omega_{6}\) is a comparable to the results of the second-order FMM on between \(\Omega_{8}\) and \(\Omega_{9}\).

Example 4: We investigate the ability of _ReSDF_ to approximate the SDF when the interface is a union of several interfaces. Such a complex mixed interface is relevant to practical problems such as the rising of multiple bubbles in multi-phase flows. The zero level sets of the level set functions \(\phi_{8}\) (30) or \(\phi_{9}\) (31) could depict cases of merged bubbles or multiple bubbles in the water, respectively. In Figure 10, predicted SDFs and the exact solutions are presented. Although the SDF has singularities over the computational domain, _ReSDF_ provides accurate interface representations for multiple nested interfaces.

Figure 5: The iso-contours of the level set function \(\phi_{4}\) (26) (left) and the results of _ReSDF_ with \(\phi_{4}\) (right) are presented with the exact solution. The red solid curve is the zero level set of \(\phi_{4}\).
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{Uniform nodes} & \multicolumn{2}{c}{Random nodes} \\ \cline{2-5}  & \(\left\|u_{\theta}-u\right\|_{2}\) & \(\left\|u_{\theta}-u\right\|_{\infty}\) & \(\left\|u_{\theta}-u\right\|_{2}\) & \(\left\|u_{\theta}-u\right\|_{\infty}\) \\ \hline \(\phi_{8}\) & \(6.16\cdot 10^{-4}\) & \(1.43\cdot 10^{-2}\) & \(6.99\cdot 10^{-4}\) & \(1.48\cdot 10^{-2}\) \\ \(\phi_{9}\) & \(6.46\cdot 10^{-4}\) & \(1.89\cdot 10^{-2}\) & \(6.01\cdot 10^{-4}\) & \(1.98\cdot 10^{-2}\) \\ \hline \hline \end{tabular}
\end{table}
Table 5: The \(L^{2}\) and \(L^{\infty}\) errors between exact and predicted SDF with \(\phi_{8}\) (30) and \(\phi_{9}\) (31) are listed. Uniform nodes are fixed by the collocation points \(\Omega_{7}\) and random nodes are sampled from the uniform distribution.
Figure 7: The iso-contours of the results of _ReSDF_ (left) and PINN approach (right) from three level set functions, \(\phi_{5}^{\alpha}\) (27) with \(\alpha=0.5\) and \(1\) and \(\phi_{6}\) (28) are presented with the approximated exact solution. The red solid curve is the zero level set of mentioned level set functions.
Figure 8: The result of _ReSDF_ with the level set function \(\phi_{7}\) 29 on \(\Omega_{6}\) is presented and compared to PINN approach. The results of using FMM on \(\Omega_{a}\), \(n=6,\ldots,9\) are also presented.
Figure 9: Signed distance functions of the zero level set of \(\phi_{7}\) 29 computed by the second-order FMM (FMM\({}^{2}\)) on \(\Omega_{n}\), \(n=6,\ldots,9\) are presented.
Figure 10: The iso-contours of the level set functions \(\phi_{8}\) (30) and \(\phi_{9}\) (31) (left) and the results of _ReSDF_ with \(\phi_{8}\) and \(\phi_{9}\) (right) are presented with the exact solution. The red solid curves are the zero level set of \(\phi_{8}\) or \(\phi_{9}\).
Another strength of the deep-learning-based approach in _ReSDF_ is that scattered collocation points can be used without any methodological modifications. We investigate the effect of the deployment of training collocation points with level set functions \(\phi_{8}\) (30) or \(\phi_{9}\) (31). The uniform collocation points \(\Omega_{7}\) and random points of the same number of \(\Omega_{7}\) sampled from the uniform distribution \(\mathcal{U}\left(-1,1\right)\) are used. Running five times with different random seeds, the average values of the \(L^{2}\) and \(L^{\infty}\) errors are reported in Table 5. The results confirm that the errors obtained by different distributions are of the same order of magnitude. In other words, it verifies that the performance of the model is not sensitively tied to the uniform distribution of the training collocation points.
Figure 11: The iso-contours of the level set functions \(\phi_{10}\) (30) and \(\phi_{11}\) (31) (left) and the results of _ReSDF_ with \(\phi_{10}\) and \(\phi_{11}\) (right) are presented on the \(z=0\) plans with the exact solution. The red solid curves are the zero level set of \(\phi_{10}\) and \(\phi_{11}\).
whole computational domain and alleviates the singularity of the SDF. We confirm that the proposed method produces accurate and robust results without tunable parameter adjustments through various experimental examples ranging from highly distorted or discontinuous level set functions to complex and irregular interfaces.

## 6 Acknowledgements

This work was supported by the NRF grant [2021R1A2C3010887], the ICT R&D program of MSIT/IITP[1711117093, 2021-0-00077], and the European Union's Horizon 2020 Research and Innovation Programme under the Programme SASPRO 2 COFUND Marie Sklodowska-Curie grant agreement No. 945478.

## Appendix A Theoretical Justification

The following theorem proves that the SDF is the minimizer of \(\mathcal{L}(u,V)\) (12) except on a set of measure zero.

**Theorem 1**.: _Let \(\Gamma\) be a hypersurface in a domain \(\Omega\subset\mathbb{R}^{n}\). The optimal solution to the functional (12) is the SDF to \(\Gamma\), except on a set of measure zero._

Proof.: Let \(u^{*}\) be the optimal solution to the functional (12). For any point \(\mathbf{x}\in\Omega\) and a unit vector \(\mathbf{v}\in\mathbb{R}^{n}\), define a function \(f_{\mathbf{v}}:\mathbb{R}^{+}\rightarrow\mathbb{R}\) by

\[f_{\mathbf{v}}\left(t\right)\coloneqq u^{*}\left(\mathbf{x}-t\mathbf{v} \right).\]

Clearly, it follows that \(f_{\mathbf{v}}\left(0\right)=u^{*}\left(\mathbf{x}\right)\) and \(\left\|f_{\mathbf{v}}^{\prime}\left(\mathbf{x}\right)\right\|\leq 0\), because

\[\left\|f_{\mathbf{v}}^{\prime}\left(t\right)\right\|=\left\|\mathbf{v}\cdot \nabla u^{*}\left(\mathbf{x}-t\mathbf{v}\right)\right\|\leq\left\|\mathbf{v} \right\|\cdot\left\|\nabla u^{*}\left(\mathbf{x}-t\mathbf{v}\right)\right\| \leq 1,\ \forall t.\]

Suppose \(f_{\mathbf{v}}\left(T\right)=0\) for some \(\mathbf{v}\in S^{n-1}\) and \(T\in\mathbb{R}^{+}\). Then, we have

\[\left|\frac{f_{\mathbf{v}}\left(T\right)-f_{\mathbf{v}}\left(0\right)}{T-0} \right|\leq 1,\]

Figure 12: Iso-surfaces cut into a section \(z=0\) of the predicted SDF with \(\phi_{10}\) (30) (left) and \(\phi_{11}\) (31) (right) are presented.
which can be reformulated as

\[\left|f_{\mathbf{v}}\left(0\right)\right|=\left|u^{*}\left(\mathbf{x}\right) \right|\leq\left|T\right.\text{ }\] (A.1)

Recall that for the distance function \(d\left(\cdot,\Gamma\right)\), there exists a unit vector \(\mathbf{v}\in S^{n-1}\) such that

\[\mathbf{x}-d\left(\mathbf{x},\Gamma\right)\cdot\mathbf{v}\in\Gamma,\]

which is identical to

\[f_{\mathbf{v}}\left(d\left(\mathbf{x},\Gamma\right)\right)=0.\]

The inequality we deduced in (A.1) leads to

\[\left|u^{*}\left(\mathbf{x}\right)\right|\leq d\left(x,\Gamma\right).\]

However, because \(u\) is the optimal solution, it satisfies \(\mathbf{x}-u^{*}\left(\mathbf{x}\right)\nabla u^{*}\left(\mathbf{x}\right)\in\Gamma\) for points \(\mathbf{x}\in\Omega\) at which \(u^{*}\) is differentiable. Therefore, it can be written as \(f_{\nabla u^{*}\left(\mathbf{x}\right)}\left(u^{*}\left(\mathbf{x}\right) \right)=0\), and hence

\[d\left(\mathbf{x},\Gamma\right)\leq\left|u^{*}\left(\mathbf{x}\right)\right|.\]

Combining both inequalities, we see that

\[\left|u^{*}\left(\mathbf{x}\right)\right|=d\left(\mathbf{x},\Gamma\right),\]

concluding the proof. 

Note that according to the proof we can obtain the SDF without the last term in (12) where the SDF is differentiable. In practice, we employ \(\mathcal{L}_{RS}\) to facilitate training at singular points discussed in Section 3.2.

## Appendix B Proof of Proposition 2

Proof.: For a given point \(\mathbf{x}\in\Omega\), let us define a function \(g:\mathbb{R}^{+}\rightarrow\mathbb{R}\) as

\[g_{\mathbf{x}}\left(t\right)=u\left(\mathbf{x}-t\nabla u\left(\mathbf{x} \right)\right).\]

It satisfies

\[\begin{cases}g_{\mathbf{x}}\left(0\right)=u\left(\mathbf{x}\right),\\ g_{\mathbf{x}}\left(u\left(\mathbf{x}\right)\right)=u\left(\mathbf{x}-u\left( \mathbf{x}\right)\nabla u\left(\mathbf{x}\right)\right)=0,\end{cases}\] (B.1)

where the last equation is deduced from the property (16). Also, since the signed distance function has a gradient with unit norm, we get

\[\left|g_{\mathbf{x}}^{\prime}\left(t\right)\right|=\left|\nabla u\left( \mathbf{x}\right)\cdot\nabla u\left(\mathbf{x}-t\nabla u\left(\mathbf{x} \right)\right)\right|\leq 1.\] (B.2)

From (B.1) and (B.2), it follows that

\[\left|g_{\mathbf{x}}^{\prime}\left(t\right)\right|=1,\]

for \(t\) between \(0\) to \(u\left(\mathbf{x}\right)\). This implies that \(\nabla u\left(\mathbf{x}\right)\) and \(\nabla u\left(\mathbf{x}-t\nabla\left(\mathbf{x}\right)\right)\) are parallel. This concludes

\[\nabla u\left(\mathbf{x}\right)=\nabla u\left(\mathbf{x}-t\mathrm{sgn}\left(u \left(\mathbf{x}\right)\right)\nabla u\left(\mathbf{x}\right)\right),\forall \text{ }t\in\left[0,\left|u\left(\mathbf{x}\right)\right|\right).\] (B.3)