# Signed-Distance Ambient FNO

- ID: 2003
- Canonical URL: https://synthcore.org/idea/2003/signed-distance-ambient-fno
- API JSON: https://synthcore.org/api/idea/2003.json
- API Markdown: https://synthcore.org/api/idea/2003.md
- Verification status: mechanism_failed
- Source: [arXiv:2608.08608](https://arxiv.org/abs/2608.08608)
- Category: architecture
- Solves: accuracy, scalability, inference-speedup
- ML areas: embedding, cnn, training, inference-speedup
- Math tags: functional-analysis, harmonic-analysis, geometry, numerical-analysis
- Ratings: usefulness 7/10; difficulty 4/10; novelty 6/10

## Idea description

Embed every variable-domain sample into one fixed ambient hyperrectangle and append its signed-distance function as an additional channel to the operator input. Deterministically extend fields outside the physical domain, resample them onto a shared latent grid, apply standard Fourier layers, then interpolate and mask the output on the requested target discretization. The network learns the operator rather than a separate geometry encoder, so the same weights can be used across shapes and mesh resolutions.

## Mathematical statement

The setup approximates a nonlinear operator \(\mathcal{G}^{\dagger}:\mathcal{A}(\Omega;\mathbb{R}^{d_a})\to\mathcal{U}(\Omega;\mathbb{R}^{d_u})\), where \(\Omega\subset\mathbb{R}^{d}\) is the physical domain, \(a\) is problem data, and \(u=\mathcal{G}^{\dagger}(a)\) is the solution field. For each sample, choose a fixed ambient box \(B=[b_1^-,b_1^+]\times\cdots\times[b_d^-,b_d^+]\) containing \(\Omega\), and represent geometry by the signed-distance function \(\phi_{\Omega}(x)=\operatorname{dist}(x,\partial\Omega)\) for \(x\in\Omega\) and \(-\operatorname{dist}(x,\partial\Omega)\) for \(x\in B\setminus\Omega\); the zero level set identifies the boundary and the sign identifies the interior. Let \(E_a(a,\Omega)\) and \(E_u(u,\Omega)\) be deterministic extensions from \(\Omega\) to \(B\), for example zero or nearest-boundary extension. The shared-grid input is \(z_0(x)=\operatorname{concat}(E_a(a,\Omega)(x),\phi_{\Omega}(x),x)\) sampled at latent points \(x_i\in B\). A Fourier layer is \(z_{\ell+1}(x)=\sigma\bigl(W_\ell z_\ell(x)+\mathcal{F}^{-1}(K_\ell\odot\mathcal{F}(z_\ell))(x)\bigr)\), where \(\mathcal{F}\) is the discrete FFT, \(K_\ell\) is a learned multiplier on retained modes, \(W_\ell\) is a pointwise linear map, and \(\sigma\) is an activation. For target points \(y_j\), prediction is \(\widehat u(y_j)=\mathcal{I}_{B\to\{y_j\}}(z_L)(y_j)\), and training uses only the physical-domain mask \(m(y)=\mathbf{1}_{\{\phi_{\Omega}(y)\ge 0\}}\).

## Key formulas

- $$\phi_{\Omega}(x)=\begin{cases}\operatorname{dist}(x,\partial\Omega),&x\in\Omega,\\-\operatorname{dist}(x,\partial\Omega),&x\in B\setminus\Omega,\end{cases}$$
- $$z_0(x)=\operatorname{concat}\bigl(E_a(a,\Omega)(x),\phi_{\Omega}(x),x\bigr),\qquad x\in B,$$
- $$z_{\ell+1}(x)=\sigma\!\left(W_\ell z_\ell(x)+\mathcal{F}^{-1}\!\left(K_\ell\odot\mathcal{F}(z_\ell)\right)(x)\right),$$
- $$\mathcal{L}=\frac{\sum_{j=1}^{N_t}m(y_j)\left\|\mathcal{I}_{B\to\{y_j\}}(z_L)(y_j)-u(y_j)\right\|_2^2}{\sum_{j=1}^{N_t}m(y_j)},\qquad m(y)=\mathbf{1}_{\{\phi_{\Omega}(y)\ge 0\}}.$$

## Implementation notes

(1) Integration point: replace the usual fixed rectangular-grid FNO input pipeline. For every training or inference sample, construct a fixed ambient box B shared by the dataset, compute a signed-distance image phi on an H-by-W or H-by-W-by-D latent grid, and concatenate phi with physical input channels and normalized coordinate channels before the lifting layer. Keep Fourier blocks unchanged. At the output, interpolate the latent prediction to the requested physical mesh and compute or return only values where phi is nonnegative.

(2) Pseudocode:
```text
for (a, geometry, target_mesh, u_target) in batch:
    phi = signed_distance(geometry, latent_grid_B)
    a_ext = deterministic_extend(a, geometry, latent_grid_B)
    x = normalized_coordinates(latent_grid_B)
    z = Lift(concat(a_ext, phi, x))
    for layer in fourier_layers:
        z = activation(W[layer](z) + ifft(K[layer] * fft(z)))
    pred = interpolate(z, target_mesh)
    mask = signed_distance(geometry, target_mesh) >= 0
    loss += sum(mask * (pred-u_target)^2) / (sum(mask)+epsilon)
update_network(loss)
```
Use zero extension initially, then compare nearest-boundary and harmonic extensions as ablations. No learned geometry encoder is required. Compute phi with a rasterized domain mask followed by a Euclidean distance transform; use bilinear or trilinear interpolation. The learned quantities are only the lifting map, pointwise maps, and Fourier multipliers K.

(3) First cheap experiment: use 2D Poisson or advection-diffusion on randomly generated circles, ellipses, and star-shaped domains. Train a 4-layer FNO on 64-by-64 latent grids with 16 Fourier modes, hold out entire shape families, and evaluate on 96-by-96 and irregular target meshes. Compare against a standard FNO without phi, a mask-channel FNO, and separate mesh-specific models. Measure relative physical-domain L2 error, unseen-geometry error, parameter count, and inference time. Success means at least 20% lower held-out cross-geometry error than the no-phi baseline while one model handles all target resolutions with no more than 10% latent-grid overhead.

## Verification

- Status: mechanism_failed
- Mechanism evidence: yes
- Mechanism confirmed: no
- Verdict: Built a small ambient-grid spectral operator with zero extension, coordinate channels, masked loss, and comparisons against no-geometry and mask-channel baselines. The exact circle SDF sign check was 1.0 at resolutions 16–96, the radius-affine slope was 0.99999984–0.99999994 versus predicted 1, and the analytic target identity error was 7.5e-9. However, held-out relative masked L2 was 1.193 for no geometry, 0.460 for mask, and 0.576 for signed distance, so the proposed channel did not beat the simpler mask baseline in this setup.

### Mechanism check

- Verdict: Built a small ambient-grid spectral operator with zero extension, coordinate channels, masked loss, and comparisons against no-geometry and mask-channel baselines. The exact circle SDF sign check was 1.0 at resolutions 16–96, the radius-affine slope was 0.99999984–0.99999994 versus predicted 1, and the analytic target identity error was 7.5e-9. However, held-out relative masked L2 was 1.193 for no geometry, 0.460 for mask, and 0.576 for signed distance, so the proposed channel did not beat the simpler mask baseline in this setup.
- Confidence: 8/10
- Limitations: This is a tiny circle-only toy task with 18 effective training epochs after the original run timed out, not the proposed circles/ellipses/stars Poisson benchmark. It does not test nearest-boundary or harmonic extension, irregular target meshes, 96x96 inference, mesh-resolution transfer, or a full 20% cross-family generalization study. CUDA spectral execution failed on the shared device and the run continued on CPU.

## Artifacts

- [experiment.py](https://synthcore.org/code/762/experiment.py)
- [report.md](https://synthcore.org/code/762/report.md)
- [results.json](https://synthcore.org/code/762/results.json)
- [Download all files as ZIP](https://synthcore.org/download/762)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
