VisDiff: SDF-Guided Polygon Generation for Visibility Reconstruction, Characterization and Recognition

Rahul Moorthy Mahesh, Jun-Jee Chao, Volkan Isler

TL;DR

VisDiff is a novel generative diffusion model that solves the "Visibility Reconstruction" problem—recreating a polygon based only on its visibility graph. By using a Signed Distance Function (SDF) as an intermediate representation rather than predicting vertex coordinates directly, VisDiff achieves a 26% improvement in accuracy over state-of-the-art methods and enables smooth interpolation across the space of possible polygons.

What Problem Does This Paper Address?

In computational geometry, a visibility graph is a discrete structure where nodes represent the vertices of a polygon, and edges connect nodes that can "see" each other (i.e., the line segment between them doesn't leave the polygon).

The "Visibility Reconstruction" problem asks: Given only this graph, can you build the polygon that created it?

Visibility Reconstruction Problem and Baseline Failure

This is notoriously difficult for two reasons:

  1. Sensitivity: A tiny nudge to a single vertex can completely rearrange the visibility graph.
  2. Lack of Metric: A graph tells you who sees whom, but it contains zero information about actual distances or coordinates.

Standard Graph Neural Networks (GNNs) struggle here because they usually rely on some underlying spatial feature to make sense of the data. Without coordinates, most generative models end up producing "geometric soup" rather than valid, closed polygons.

Methods

The authors introduce VisDiff, which breaks the reconstruction process into two distinct stages using a diffusion-based approach.

VisDiff Architecture
  1. Graph-Conditioned SDF Diffusion: Instead of jumping straight to $(x, y)$ coordinates, VisDiff first generates a Signed Distance Function (SDF). An SDF is essentially a grid where each pixel stores its distance to the polygon's boundary. The model uses a U-Net architecture conditioned on the input visibility graph via cross-attention mechanisms.
  2. Vertex Extraction: Once the model has a predicted SDF, it needs to turn that "blurry" distance field back into a sharp polygon. It uses a specialized extraction block that combines pixel-aligned features (to capture fine details) and a transformer-based vertex predictor to output the final ordered list of coordinates.

The "Secret Sauce": The transition through the SDF is the key innovation. The SDF acts as a continuous spatial bridge between the discrete, combinatorial world of graphs and the continuous world of geometry.

Datasets

The researchers found that existing random polygon generators were biased, often producing overly concave shapes as vertex counts increased. To fix this, they created a new, curated dataset:

  • Scale: 370,000 polygons with corresponding visibility and triangulation graphs.
  • Diversity: They systematically rebalanced the dataset based on link diameter (a measure of a polygon's concavity/complexity).
  • OOD Testing: They curated specific "Out-of-Distribution" sets featuring classic geometric shapes like Star, Spiral, Anchor, and Terrain polygons to test the model's ability to generalize.

Key Insights and Ideas

  • SDFs are better than Coordinates: The most significant "aha moment" is that predicting a field (SDF) is much easier for a neural network than predicting a sequence of points when the input is purely combinatorial. The SDF provides a dense signal that guides the model toward a valid shape.
  • The Manifold is Continuous: By interpolating between different noise seeds or even between two different triangulation graphs, the authors showed that VisDiff learns a smooth "polygon manifold." You can actually watch one valid polygon morph into another while maintaining the required visibility constraints.
  • Recognition vs. Reconstruction: The model doesn't just build polygons; it can act as a classifier. If you give it a graph that cannot physically exist as a simple polygon, VisDiff fails to generate a high-confidence SDF, effectively "recognizing" that the input is invalid.

Key Results

  • Performance Leap: VisDiff achieved a 26% improvement in F1-score over standard baselines like Vertex-Diffusion and GNN-based generators.
  • High Fidelity: Qualitatively, VisDiff is the only model among those tested that consistently produces closed, non-self-intersecting polygons that actually match the target visibility graph.
  • Generalization: While designed for visibility graphs, the model successfully generalized to triangulation graphs, proving the architecture is robust for various combinatorial structures.
  • Recognition Accuracy: The model correctly identified valid vs. invalid visibility graphs with 90% accuracy.

Limitations and Future Work

Despite its success, VisDiff has a few hurdles to clear:

  • Resolution Bottleneck: The current model represents the SDF on a 40x40 grid. While fine for simple shapes, more complex polygons with hundreds of vertices would require much higher resolutions, leading to computational bottlenecks.
  • Inference Speed: Because it uses a two-stage process (Diffusion -> SDF -> Vertex Extraction), it is significantly slower than "one-shot" GNN models (taking ~1 second per sample vs. ~0.005 seconds).
  • Future Directions: The authors suggest exploring more efficient SDF encodings and potentially using Large Language Model (LLM) "coding" approaches to incorporate even stricter geometric consistency mechanisms.

Summary updated

BibTeX
@inproceedings{mahesh2025visdiff,
  author = {Rahul Moorthy Mahesh and Jun-Jee Chao and Volkan Isler},
  title = {{VisDiff: SDF-Guided Polygon Generation for Visibility Reconstruction, Characterization and Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8M9T7Nl454},
}
Figure