Turning a picture of a building, road or object into a clean polygon forces a choice about how many corners to keep. With too many corners, the outline copies every jagged pixel of the segmentation. With too few, it slides off the true edges. Current learned systems settle this choice in one of two ways. Some fix the choice inside the architecture: a 36-slot output head, or a dense contour that is never thinned. Others hand it to a hand-tuned simplification step after the network has run. We propose a network that outputs a ranked set of polygon vertices, so that keeping the top $k$ gives a good $k$-vertex outline for every $k$ at once. A user, a map-scale setting or a downstream engine can then pick any point on the fidelity–simplicity curve without retraining and without a second pass.
The architecture splits the work between two components. Convolutions are local filters that are good at sharp edges, so they decide where vertices can sit, at full image resolution. Self-attention is a transformer layer in which every vertex looks at every other vertex, so it decides which vertices matter. We argue the second decision is global. Whether deleting a corner is harmless depends on the whole outline: its closure, its symmetry, and whether a long wall elsewhere already explains the same edge. A local corner-strength score cannot judge that. Our central testable prediction follows from this: the gain from attention should be small when many vertices are kept and large when few are.
Core Claim
We claim that a fast, non-autoregressive model can learn a nested vertex ranking. It combines a convolutional pixel stage with a transformer that runs over the vertices of each instance. With that ranking, a single forward pass traces the full fidelity–simplicity curve, and that curve sits above both the cascaded "segment then Douglas–Peucker" curve and a ranking built from local features alone. Measured as boundary quality at matched vertex counts, it should approach autoregressive vectorizers while running at a fraction of their latency. This targets a concrete gap in the file. GeoFormer chooses its own vertex count by generating coordinates one token at a time and reaches 91.5 AP on the Aicrowd Mapping Challenge, but takes 1.93 s per image against 0.03 s for HiSup. PolyTransform is fast (about 21 ms per instance), but its vertex transformer only moves an existing dense contour and never removes vertices. Neither exposes the tradeoff as something a user controls.
Relation to Prior Work
Three papers motivate the gap. GeoFormer, P2PFormer and InceptCurves each make the simplicity decision once, at a single operating point. GeoFormer does so through when its sequence stops. P2PFormer assigns detected corners into 36 fixed order slots, which caps polygon complexity and clashes with courtyards. InceptCurves zero-pads a fixed $10\times2$ control-point matrix. We instead train for every budget at once and read out a budget at test time. The 3D abstraction literature shows the same pattern: HiT fixes the number of parts per level and over-segments as a result. This suggests the problem is general, but we stay in 2D, where the benchmarks have hard numbers.
Two papers supply the method. PolyTransform supplies the backbone recipe. A segmentation mask is traced into an ordered dense contour, a convolutional feature pyramid with coordinate channels provides local features, and a transformer over vertices predicts offsets. We keep this structure because tracing gives vertex order and multiple rings (holes) for free, which avoids the hard ordering problem that P2PFormer and GeoFormer solve with slots or autoregression. To that structure we add a per-vertex importance output and train it so that truncation is meaningful. Approximating shapes in images with low-complexity polygons supplies the supervision: its energy-minimizing split-and-merge yields near-optimal low-complexity polygons from ground-truth outlines, and we use them as per-budget targets.
Two lines of work constrain the design. First, PolyTransform reports that a wrong or missing initial mask cannot be recovered downstream. Our method inherits that failure, so we evaluate mask quality separately and do not claim to fix it. Second, the frame-field building work (BUILDING OUTLINE EXTRACTION…) shows that a single hand-set tolerance either rounds off corners or keeps raster noise. That observation is the reason for exposing a whole curve rather than one tuned point. The 3D hybrids TransBTS and UNETR show that convolution plus attention helps boundary localization in dense prediction, but they output unconstrained voxel grids. They are evidence for the local–global split, not competitors.
Research Program
The model has two stages. In the first, a convolutional instance segmenter produces masks. Each mask is traced into ordered rings, sampled at roughly one vertex per few pixels. In the second, every vertex becomes a token. The token holds bilinearly sampled features from a full-resolution convolutional pyramid, its coordinates, and its ring index. A transformer over all tokens of an instance outputs a small sub-pixel offset and a scalar importance score $s_i$. The polygon at budget $k$ consists of the $k$ highest-scoring vertices, connected in their original ring order. Because order comes from tracing, truncation never creates self-crossing orderings, although the geometry can still self-intersect. We count self-intersections as a reported failure.
Training makes every prefix good. For a sampled budget $k$, we approximate top-$k$ selection with a differentiable soft-top-$k$ mask over the scores. The selected vertices are rasterized with a soft rasterizer, and the result is compared to the ground-truth polygon. The objective averages over budgets:
$$\mathcal{L} = \mathbb{E}_{k \sim p(k)}\big[\,\mathcal{L}_{\text{fid}}(P_k, G) + \beta\, \mathcal{L}_{\text{target}}(P_k, G^{*}_k)\big]$$
In this objective, $P_k$ is the predicted $k$-vertex polygon, $G$ is the ground-truth outline, and $\mathcal{L}_{\text{fid}}$ combines soft-raster IoU loss with Chamfer distance between boundaries. $G^{*}_k$ is the split-and-merge simplification of $G$ to $k$ vertices, $\mathcal{L}_{\text{target}}$ is a vertex-matching distance to that simplification, and $\beta$ weights it. The budget distribution $p(k)$ is log-uniform between 3 and the dense count, so low budgets get enough attention. This is the fidelity–simplicity energy from the parsimony literature. The difference is that the penalty weight is not fixed in advance: we integrate over it, which lets the user choose it at inference.
The analysis program asks whether attention is actually doing the global part of the job. We will probe the learned importance scores in three ways. We will measure whether scores of vertices on one wall shift when a distant wall is occluded. We will compare learned rankings against local curvature and turning angle. And we will check whether score maps respect a building's mirror symmetry.
Baselines
The naive reference is the cascaded pipeline: the same segmenter's mask is traced and simplified with Douglas–Peucker, with the tolerance swept to produce a curve. It uses identical masks, so any gap between it and our model is due to the vertex stage alone. Because it provides a free tradeoff curve, it is the baseline most likely to embarrass the proposal. Beating it means a higher boundary-quality curve at every budget below the dense count, not just on average.
A stronger cascaded variant runs our own stage-two network with the importance head removed. That is PolyTransform-style offset refinement trained identically. Douglas–Peucker is then applied to the refined contour. This separates "better vertex positions" from "better vertex selection." The proposal must beat it specifically at low budgets.
The strongest existing method is GeoFormer. It reports 91.5 AP on the Aicrowd Mapping Challenge against 79.4 for HiSup, a 30% boundary-AP gain over prior methods, and 1.93 s per image against HiSup's 0.03 s. GeoFormer emits one vertex count per building, so we compare at its own operating point. We read our curve at GeoFormer's per-instance vertex count and report AP, boundary AP and wall-clock time on the same GPU. Where code allows, we retrain it on our splits with a matched training budget; otherwise we use its released numbers and say so. Beating it means matching its AP within one point at its vertex count while running at least an order of magnitude faster. Exceeding its AP is not required for the claim. For P2PFormer, the file gives only relative figures (+2.7 AP and +6.5 AP$_{75}$ over PolyWorld on CrowdAI, +4.8 AP over mask baselines on WHU). No absolute number was found on Lacuna, so we will rerun it rather than quote it.
The key ablation isolates attention. The variant replaces the transformer with a per-vertex multilayer perceptron on the same convolutional features, so importance becomes purely local. A third variant swaps in a pure-transformer pixel stage, which tests whether the convolutional stage matters for localization. All variants share the segmenter, data, augmentation, epochs and a fixed hyperparameter search budget.
Why not just…?
Why not just segment and run Douglas–Peucker at whatever tolerance you want? This is the real threat. It already provides any-budget polygons at near-zero cost. Douglas–Peucker removes vertices by distance to a chord, a local, greedy criterion. It also inherits raster staircase noise that frame-field work had to hand-tune around (BUILDING OUTLINE EXTRACTION…). We have no published curve showing it loses, so the first experiment is exactly this comparison on identical masks. If our curve does not clear it at low budgets, the project reduces to "PolyTransform refinement plus Douglas–Peucker," and we would report that.
Why not just add a length penalty or stopping threshold to an autoregressive decoder like GeoFormer? That would give budget control. But every budget would still pay the 1.93 s sequential decoding cost, and the outputs at different budgets would not be nested: the 8-vertex polygon need not be a subset of the 12-vertex one. Nesting is what lets a map renderer switch level of detail smoothly. We will measure nestedness explicitly, as the fraction of shared vertices between consecutive budgets, alongside the latency comparison.
Why not just score vertices with a convolutional corner detector and threshold? This is the cheapest learned alternative, and our MLP ablation implements it. The evidence that it should fall short is indirect. DeFormer argues that limited receptive fields keep convolutional networks from coordinating global primitive layouts, and InceptCurves is a purely convolutional curve fitter with no mechanism for loop closure. If the ablation matches the full model at all budgets, our claim that vertex selection is a global decision is wrong, and we would drop the transformer.
Proposed Experiments
The main benchmarks are the Aicrowd/CrowdAI mapping data and WHU Building, as used by GeoFormer and P2PFormer. Cityscapes instances, as used by PolyTransform, cover curved, non-rectilinear objects, where corner-based priors help less. On the building sets we also slice out instances with interior courtyards, the case both slot-based and autoregressive methods are reported to mishandle.
The primary metric is a fidelity–simplicity curve: boundary IoU and boundary AP plotted against mean vertices per instance, summarized by the area under it over a fixed budget range. Secondary metrics are AP at the ground-truth vertex count, latency per image, the self-intersection rate, and nestedness.
The first decisive check is whether our curve dominates segment-plus-Douglas–Peucker and refine-plus-Douglas–Peucker on identical masks. The second is whether the gap between the full model and the local-only ablation grows as the budget shrinks. This is the specific signature predicted by the claim that attention handles global selection. The third is whether, at GeoFormer's operating point, we reach comparable AP at least ten times faster. A clear failure on the first check ends the proposal. Success on the first and failure on the second means the transformer is unnecessary, and we would say so.
References
- GeoFormer: A Multi-Polygon Segmentation Transformer
- PolyTransform: Deep Polygon Transformer for Instance Segmentation
- P2PFormer: A Primitive-to-polygon Method for Regular Building Contour Extraction from Remote Sensing Images
- InceptCurves: curve reconstruction using an inception network
- HiT: Hierarchical Transformers for Unsupervised 3D Shape Abstraction
- Approximating shapes in images with low-complexity polygons
- BUILDING OUTLINE EXTRACTION FROM AERIAL IMAGERY AND DIGITAL SURFACE MODEL WITH A FRAME FIELD LEARNING FRAMEWORK
- TransBTS: Multimodal Brain Tumor Segmentation Using Transformer
- UNETR: Transformers for 3D Medical Image Segmentation
- DeFormer: Integrating Transformers with Deformable Models for 3D Shape Abstraction from a Single Image