Gradient Distance Function

Hieu Le, Federico Stella, Benoît Guillard, Pascal Fua

TL;DR

Learning Unsigned Distance Functions (UDFs) to represent non-watertight 3D surfaces is notoriously unstable because the zero-level set lies directly on a non-differentiable cusp. The authors introduce the Gradient Distance Function (GDF), which instead predicts the 3D displacement vector pointing to the nearest surface point. This simple formulation makes the field smooth and sign-switching across the surface, yielding significantly cleaner meshes with fewer holes and faster training.

What Problem Does This Paper Address?

Implicit representations like Signed Distance Functions (SDFs) are powerful tools for 3D modeling, but they require closed, "watertight" meshes with well-defined interiors and exteriors. For open surfaces—such as garments, car bodies with interior cabin details, or open architectural scenes—practitioners turn to Unsigned Distance Functions (UDFs).

However, UDFs are difficult to train with neural networks. Because unsigned distance is strictly non-negative ($u \ge 0$), the target surface is located exactly at the non-differentiable local minima of the field. When neural networks fail to reach exactly zero, the reconstructed mesh exhibits missing patches (holes). Conversely, if the network outputs near-zero values across a region, it produces artificial "double surfaces" or thickened walls.

Methods

The paper replaces scalar distance prediction with a 3D vector field:

  • The GDF Formulation: For any query point $\mathbf{x}$, GDF predicts the vector $\mathbf{v} = \hat{\mathbf{x}} - \mathbf{x}$ pointing directly to the closest surface point $\hat{\mathbf{x}}$.
  • Derived Properties:
  • The unsigned distance is simply the Euclidean norm: $u = \|\mathbf{v}\|$.
  • The unit normal gradient is $\mathbf{g} = \frac{1}{u}\mathbf{v}$.
  • Surface Differentiability: When crossing a thin surface from one side to the other, the vector $\mathbf{v}$ passes smoothly through zero and switches signs component-by-component. This mimics the smooth zero-crossing behavior of an SDF without requiring an interior/exterior volume.
  • Network Training & Losses: Networks (MLPs or latent-conditioned auto-decoders) are trained with an L1 loss on the predicted vector $\mathbf{v}$. The authors also introduce an optional multi-task loss that explicitly supervises the vector $\mathbf{v}$, the normalized gradient $\mathbf{g}$, and the scalar distance $u$.
  • Meshing: Surfaces are extracted using MeshUDF. Because $\mathbf{g}$ is directly accessible from $\mathbf{v}$, meshing requires no expensive backpropagation passes through the network.
       Query x                         Closest point x̂
          o ------------------------------> *
                      Vector v
             (magnitude = distance u)
             (direction = surface gradient g)

Datasets

The authors evaluate GDF on three standard benchmarks across both single-shape fitting and categorical auto-decoding:

  1. Multi-Garment Net (MGN): 320 single-layer open-surface garment meshes (shirts, pants).
  2. ShapeNet-Car: Evaluated in two configurations:
  3. ShapeNet-Car (R): 3,091 raw models containing open boundaries, hoods, and inner structures.
  4. ShapeNet-Car (P): Cleaned, pre-processed watertight car meshes.
  5. 3D-Scene: 7 complex indoor/outdoor scenes containing intricate open geometry (e.g., furniture, thin partitions).

Key Insights and Ideas

  • Gradients for Free: Most UDF meshing algorithms (such as MeshUDF) rely heavily on field gradients. Standard UDF networks must compute these gradients via backpropagation during inference, which is computationally heavy. GDF outputs the direction directly in the forward pass.
  • Sign-Flipping Without Inside/Outside: Rather than defining a global "inside" and "outside," each coordinate component of the vector field flips sign locally across the surface tangent frame, resolving the gradient vanishing/cusp problem.
  • Rapid Convergence: GDF avoids the optimization plateaus common to UDFs. Qualitative fitting shows smooth, hole-free reconstructions in as few as 3,000 training iterations, whereas baselines like NDF still exhibit large holes.

Key Results

GDF was evaluated against NDF (direct UDF learning), CSP (closest surface point regression), and 3PSDF (three-pole sign classification):

  • Single Shape Representation: On the complex 3D-Scene dataset, GDF achieves a Chamfer Distance (CD $\times 10^4$) of 0.20 and Normal Consistency (NC) of 87.1, significantly outperforming NDF (0.27 CD / 85.7 NC) and CSP (3.01 CD / 71.5 NC).
  • Category Auto-Decoders (Known Shapes): On raw cars with complex interiors (ShapeNet-Car R), GDF cuts the error by more than half compared to NDF (0.34 vs. 0.76 CD) and boosts normal consistency (62.66 vs. 58.73 NC).
  • Generalization to Unseen Shapes: When fitting latent codes to 10,000 sparse surface points on raw cars, GDF reaches 0.53 CD compared to 0.78 for NDF and 0.87 for CSP.
  • High-Resolution Meshing: When meshing at $768^3$ grid resolution, GDF preserves thin, continuous surfaces without the tearing and staircase artifacts typical of NDF.

Limitations and Future Work

  • Medial Axis Discontinuities: GDF is non-differentiable at the medial axis (points equidistant to multiple surface patches). While these regions are typically far from the surface and excluded during surface-biased point sampling, near-surface medial axes can occasionally introduce local errors.
  • Zero-Crossing Alignment: Because the output is a 3D vector, the zero-crossings of all three scalar components must coincide precisely at the surface point; slight cross-dimensional misalignments can occur.
  • Future Directions: The authors suggest developing adaptive sampling strategies prioritizing near-surface medial axes and enforcing explicit consistency constraints across vector field components.

Summary updated

BibTeX
@inproceedings{le2025gradient,
  author = {Hieu Le and Federico Stella and Benoît Guillard and Pascal Fua},
  title = {{Gradient Distance Function}},
  booktitle = {Wild3D @ ICCV},
  year = {2025},
  url = {https://openreview.net/forum?id=WktJ40v3op},
}
Figure