GeoFormer: A Multi-Polygon Segmentation Transformer

Maxim Khomiakov, Michael Riis Andersen, Jes Frellsen

TL;DR

GeoFormer is a novel end-to-end transformer architecture that treats building vectorization as a sequence generation task. By modeling building corners as spatially dependent tokens, it bypasses the messy "segmentation-then-post-processing" pipeline, outperforming state-of-the-art methods on the Aicrowd Mapping Challenge by nearly 12 percentage points in Average Precision.

What Problem Does This Paper Address?

In remote sensing, we often need to turn satellite pixels into vector polygons (e.g., for urban planning or map making). Traditionally, this is a two-step "raster-to-vector" headache:

  1. Semantic Segmentation: A model predicts which pixels belong to a building.
  2. Post-processing: Heuristics or secondary models try to "trace" these fuzzy pixel blobs into clean, sharp-edged polygons.

This approach is brittle. Pixel-based models are often most uncertain at the edges—exactly where you need precision for a polygon. Furthermore, balancing multiple loss functions for edges, corners, and masks is an optimization nightmare. GeoFormer asks: What if we just predicted the coordinates of the corners directly in one go?

Methods

The authors propose an image-to-sequence architecture that treats building vertices like words in a sentence.

  • The Encoder: It uses a SWINv2 backbone to extract features. Crucially, it employs a pyramidal feature map that fuses information from four different scales. This allows the model to "see" both the fine details of a corner and the global context of the building's shape.
  • The Decoder: An auto-regressive transformer decoder predicts a flattened sequence of $(x, y)$ coordinates. To handle multiple buildings in one image, they introduced a special separator token ($||$) that tells the model, "I'm done with this building; moving to the next one."
  • Attention Tricks: To help the model understand spatial relationships, they combined several advanced positional embedding techniques:
  • ALiBi (Added Linear Bias): Helps the model focus on nearby tokens (local geometry).
  • RoPE (Rotational Positional Embeddings): Helps the model learn relative spatial dependencies between vertices.
  • The Loss: Unlike previous SOTA methods that juggle 3-5 different loss terms, GeoFormer is trained using a single negative log-likelihood function, making the training process significantly more stable.

Datasets

The model was evaluated on the Aicrowd Mapping Challenge dataset, a popular benchmark for building delineation.

  • Scale: Over 340,000 satellite images (300x300 resolution) with roughly 2.4 million building instances.
  • Resolution: 30 cm per pixel.

Key Insights and Ideas

  • Geometry as Language: The most powerful insight is that multi-polygon prediction is structurally similar to image captioning. If a model can "describe" an image with words, it can "describe" it with an ordered list of coordinates.
  • The Power of Simplicity: By moving to a single likelihood function, the authors proved that "tabula rasa" (from scratch) training can beat complex, multi-stage pipelines that rely on pre-trained bounding box detectors or heuristic filters.
  • Pyramidal Fusion is Critical: The ablation studies showed that without the pyramidal feature maps and advanced positional embeddings (ALiBi/RoPE), the model struggles to converge. The model needs to "re-enforce" token positions at every layer to maintain geometric sanity.

Key Results

GeoFormer sets a new high bar for the Aicrowd benchmark:

  • Accuracy: It achieved an Average Precision (AP) of 91.5, a massive jump from the previous best of 79.4 (HiSup).
  • Polygon Fidelity: It showed a 30% improvement in boundary AP (bAP), meaning the predicted edges are much closer to the actual building walls than previous methods.
  • Robustness: In stress tests involving image rotation and random pixel dropout, GeoFormer remained more stable than its competitors, likely due to its "masked" training approach.

Limitations and Future Work

While GeoFormer is highly accurate, it pays a "speed tax":

  • Inference Latency: Because it generates tokens one-by-one (auto-regressive), it is significantly slower than raster-based models. It takes 1.93 seconds per image, whereas the fastest competitor (HiSup) takes only 0.03 seconds.
  • Resolution Bottleneck: The decoder currently works on a 36x36 feature map. While this works for the current benchmark, mapping very large, complex urban scenes might require higher-dimensional feature maps, which could hit memory limits due to the quadratic complexity of attention.
  • Future Directions: The authors suggest exploring "discretized mixture of logistics" (similar to PixelCNN++) to improve coordinate precision and potentially moving toward 3D building representation.

Summary updated

BibTeX
@inproceedings{khomiakov2024geoformer,
  author = {Maxim Khomiakov and Michael Riis Andersen and Jes Frellsen},
  title = {{GeoFormer: A Multi-Polygon Segmentation Transformer}},
  booktitle = {BMVC},
  year = {2024},
  url = {https://openreview.net/forum?id=ySeT7uENX9},
}

Loading related content...

Figure