Skip to content
AI.info

Research

SharpNet: Enhancing MLPs to Represent Functions with Controlled Non-differentiability

Overview Research area: Implicit neural representations for geometry — specifically multi-layer perceptrons (MLPs) that model signed distance fields for CAD reconstruction and 2D distance fields. Tech

SharpNet: Enhancing MLPs to Represent Functions with Controlled Non-differentiability
arXiv
2601.19683
Published
2026-01-27
Authors
Hanting Niu, Junkai Deng, Fei Hou, Wencheng Wang, Ying He

AI summary

Overview

Research area: Implicit neural representations for geometry — specifically multi-layer perceptrons (MLPs) that model signed distance fields for CAD reconstruction and 2D distance fields.

Technical level: Advanced. The paper builds on classical partial differential equation (PDE) theory, Green's functions, and boundary-integral formulations, and derives two theorems about when non-differentiability propagates through network composition.

One-sentence scope: The paper introduces SharpNet, an MLP variant augmented with an auxiliary "feature function" derived from Poisson's equation with jump Neumann boundary conditions, so that a network can place exact C⁰ (continuous but non-differentiable) sharp features at user-specified or learnable locations while staying smooth everywhere else.

What This Paper Is About

Standard MLPs with smooth activations are C^∞ and therefore cannot represent true gradient discontinuities, while ReLU-based MLPs are C⁰ but give no control over where their non-differentiabilities land. SharpNet addresses this by adding a geometric prior to the network input: an auxiliary feature function that is non-differentiable exactly on a chosen curve (2D) or surface (3D) set M, and infinitely smooth elsewhere. The goal is to recover sharp edges and corners accurately in 2D distance-field fitting and 3D CAD reconstruction, without the post-processing, patch subdivision, or grid subdivision that competing methods require.

Key Contributions

  1. A PDE-based feature function. The authors define the feature function f as the solution to Poisson's equation ∇²f(x) = h(x) on Ω\M, subject to a jump Neumann condition (a prescribed jump g(x) in the one-sided normal derivative across M) and a continuity condition across M. Theorem 3.2 states these conditions are necessary and sufficient for f to be C⁰-continuous across M and twice differentiable on Ω\M.

  2. A propagation theorem for non-differentiability. Theorem 3.1 shows that if f is non-differentiable on a codimension-one set M and the network's partial derivative with respect to the feature channel ∂Φ_θ/∂u does not vanish on M, then the composed field x ↦ Φ_θ(x, f(x)) is differentiable on Ω\M and non-differentiable on M. The paper also identifies two failure modes: feature insensitivity (weights on f vanish) and local flattening (the outer function's derivative with respect to f is zero at the feature point).

  3. Efficient evaluation and learnable feature geometry. The solution is written in boundary-integral form via Green's third identity, and for the special case h(x) = 0, g(x) = 1 it reduces to f(x) = ∫_M G(x, y) dS_y, which has closed-form integrals over line segments (2D) and triangular faces (3D). A localized version multiplies each sub-integral by a compactly supported mollifier so that the global integral collapses to a local one. The feature function is differentiable with respect to the feature locations, so M and the MLP parameters can be optimized jointly.

  4. Handling discontinuities in the derivative jump. Because the directional-derivative jump D∂_n Φ can itself be discontinuous (at junctions and at 3D corners where concave and convex edges meet), the authors partition M into disjoint subsets, compute a separate feature function per subset, and feed all of them into the network as Φ_θ(x, 𝔣⁽¹⁾(x), …, 𝔣⁽𝔫⁾(x)). In 2D this partition is framed as an edge-coloring problem on the graph of feature segments, with discontinuities allowed only at junctions (vertices of degree ≥ 3); in 3D, strip-like surfaces are built around sharp edges and colored the same way.

Main Findings

  • SharpNet recovers sharp features; baselines blur them. The abstract reports that SharpNet accurately recovers sharp edges and corners while remaining smooth away from them, whereas existing methods tend to blur gradient discontinuities, across both 2D problems and 3D CAD reconstruction.
  • InstantNGP fails on non-smooth fields. In Figure 1's distance-field example for a 2D closed curve (non-differentiable along the medial axis), InstantNGP's learned field visibly deviates from the intended non-smooth behavior, shown via a height-field rendering; in the 3D CAD case from points with normals, InstantNGP introduces notable artifacts, particularly around sharp edges.
  • NH-Rep cannot represent open sharp edges. NH-Rep builds CAD models through patch subdivision and forms sharp edges via patch intersections, which makes open (non-closed) sharp edges difficult to handle. SharpNet produces strictly C⁰-continuous sharp features regardless of whether they are closed, without requiring patch or grid subdivision.
  • The unsigned distance function (UDF) is not suitable as a feature function. The authors argue that while the UDF is C⁰-continuous and non-differentiable on a set M, it is also non-differentiable along the medial axis of M, which generally does not coincide with the intended feature set. Discretizing M into a triangle mesh makes this worse, since every angular bisector plane between adjacent faces creates an extra medial axis. The smooth-clamping variant used in prior work only removes the medial axis where d(p) ≥ s, leaving it for d(p) < s, and is only C¹ at d(p) = s. The UDF in that prior work is also not learnable, likely because finding the closest triangle face is not differentiable.
  • Directional-derivative jumps carry a sign convention. With the sign convention of the signed distance function positive outside and negative inside, convex portions of a surface correspond to positive directional derivative jumps on the interior medial axis, while concave portions correspond to negative jumps on the exterior medial axis; these can meet at saddle-like junctions, making D∂Φ discontinuous itself.
  • Quantitative result values are not reported in the available content. The paper states that qualitative and quantitative results demonstrate effectiveness, but the truncated content does not include the numerical tables, error metrics, or dataset sizes, so no specific figures can be cited.

Methodology in Plain English

Take an ordinary MLP that maps a coordinate x to a value, such as a signed distance. On its own it can only produce smooth outputs. SharpNet adds extra input channels: for each coordinate, it also feeds in the value of a special "feature function" evaluated at that coordinate.

That feature function is designed using a classical physics equation, Poisson's equation. Instead of solving it directly over the whole domain, the authors express the solution as an integral over the feature curve or surface, using the Green's function of the Laplacian. This integral measures how much each piece of the feature set contributes to the value at a query point. The key property is that the resulting function is continuous across the feature set, but its derivative jumps there, exactly the behavior needed for a sharp edge. In 2D the contribution of each line segment, and in 3D the contribution of each triangle, has a closed-form expression.

To keep this cheap, each piece of the feature set is multiplied by a smooth, compactly supported "bump" function (a mollifier) centered on that piece, so only nearby elements contribute to the value at any point. The bump function is smooth, and the distance surrogate used inside it is squared to keep everything differentiable.

Because the whole construction is differentiable with respect to where the feature elements are placed, the feature geometry itself can be learned jointly with the network weights. When different feature regions need different jump magnitudes, the authors split the feature set into groups and give each group its own feature channel; in 2D an edge-coloring of the feature graph decides the split.

The evaluation covers 2D distance-field fitting with known feature curves and medial-axis learning with unknown ones, plus 3D CAD reconstruction from meshes, oriented points, and unoriented points. The 2D setup uses a Softplus-activated MLP with four hidden layers of 256 neurons (β = 100) compared against a plain MLP, a ReLU variant of SharpNet, and InstantNGP (levels reduced from 16 to 8, inputs remapped to [0.0, 0.9]², positional encoding with 4 frequencies for the geodesic experiments and 8 for the medial-axis experiments). Training minimizes a loss that combines mean absolute error against the ground-truth field with a regularization term weighted by α = 0.5, which encourages uniform polyline segments and prevents folding.

Why This Matters

Impact on research. SharpNet offers a principled alternative to ad hoc post-processing for non-smooth targets. It contributes theoretical conditions (Theorems 3.1 and 3.2) for when non-differentiability survives composition in a network, and it distinguishes itself from triangulation-based discontinuity-aware neural fields, whose mesh-based barycentric interpolation causes sharpness to "leak" onto unintended mesh boundaries. It also extends implicit CAD work (NH-Rep, Patch-Grid, NeurCADRecon, NeuVAS) by controlling where non-differentiability occurs rather than relying on patch decomposition.

Real-world applications.

  • CAD reconstruction from point clouds, where preserving sharp edges and corners is as important as recovering smooth surfaces.
  • Reverse engineering of mechanical parts from scanned meshes or oriented point clouds, including parts with open (non-closed) sharp edges.
  • 2D geometric processing tasks such as medial-axis extraction and distance-field computation for shapes.
  • Neural field representations for view synthesis and 3D reconstruction pipelines that currently use MLPs or hash-grid encodings.

Industry relevance. The stated goal of geometric fidelity in CAD matters for manufacturing, design, and simulation workflows, where blurred or rounded edges change downstream geometry. Because SharpNet needs no patch or grid subdivision, it may simplify pipelines that currently depend on segmented inputs.

Future Directions

  • Generalizing beyond the studied settings: the paper restricts itself to d ∈ {2, 3} with scalar outputs (m = 1) and feature dimension n = 1, so higher-dimensional domains, vector-valued outputs, and richer feature channels remain open.
  • Extending the feature-function construction beyond the simplified case h(x) = 0, g(x) = 1 used for the closed-form integrals, to general source terms h and spatially varying jump functions g.
  • Better handling of non-manifold feature points (Y-junctions in 2D and non-manifold edges in 3D), where the normal vector n_x is not well defined and the jump conditions are stated only for M \ ∂M.
  • Testing whether the edge-coloring partition strategy scales: the authors use as few colors as possible to keep feature dimensionality manageable, and the practical cost of that dimensionality on large CAD models is an open question.

Target Audience

Researchers and graduate students in computer vision, computer graphics, and geometric deep learning who work on implicit neural representations, signed distance functions, or neural CAD reconstruction. It is also relevant to readers interested in the theory of neural network expressivity for non-smooth functions, and to practitioners building neural fields that must respect exact geometric constraints. The PDE and boundary-integral machinery makes it most accessible to readers with some background in numerical analysis or differential geometry.

Authors’ abstract

Multi-layer perceptrons (MLPs) are a standard tool for learning and function approximation, but they inherently produce globally smooth outputs. Consequently, they struggle to represent functions that are continuous yet intentionally non-differentiable (i.e., functions with prescribed $C^0$ sharp features) without ad hoc post-processing. We present SharpNet, a modified MLP architecture that encodes user-specified sharp features by augmenting the network with an auxiliary feature function defined as the solution to Poisson's equation with jump Neumann boundary conditions. This feature function is evaluated via an efficient local integral and is fully differentiable with respect to the feature locations, allowing us to jointly optimize both the feature locations and the MLP parameters to recover the target function or geometry. This construction provides precise control over where non-differentiability occurs, enforcing the desired $C^0$ behavior at feature locations while preserving smoothness elsewhere. We validate SharpNet on 2D problems and 3D CAD reconstruction, and compare it with several state-of-the-art baselines. In both settings, SharpNet accurately recovers sharp edges and corners while remaining smooth away from them, whereas existing methods tend to blur gradient discontinuities. Qualitative and quantitative results demonstrate the effectiveness of our approach. Our project page, code and models are publicly available at https://sharpnettech.github.io.

Read the original paper