Manuscript Offprint

arXiv:2609.08660

CoordFormer: Give Me Any Coordinates and I Will Give You Labels

Iacopo Curti, Pierluigi Zama Ramirez, Alioscia Petrelli, Luigi Di Stefano

Iacopo Curti¹ ID Pierluigi Zama Ramirez² ID Alioscia Petrelli³ ID Luigi Di Stefano¹ ID

¹CVLab, University of Bologna ²Ca’ Foscari University of Venice ³SINA, company

Figure

Figure 1. Segmentation results by COORDFORMER on MaSS13K [59] (left), DIS5K [39] (center) and KPIs [16] (right). COORDFORMER predicts labels directly at selected pixel locations, enabling highly detailed segmentation of very-high-resolution images. This design allows COORDFORMER to capture thin structures and fine boundaries.

Abstract

Semantic segmentation on very-high-resolution images remains challenging due to the high computational cost and the difficulty of capturing fine-grained details. We propose COORDFORMER, a novel coordinate-based architecture for semantic segmentation that predicts labels at arbitrary spatial locations through a Coordinate Decoder equipped with a Localized Cross-Attention mechanism. The decoder combines coordinate embeddings with high-resolution local patch features and interacts with global tokens extracted from a downsampled image processed by a ViT foundation encoder, enabling rich semantic context while preserving pixel-level precision. This design enables flexible inference at arbitrary resolutions while keeping memory low on very-high-resolution inputs, and supports an efficient semantic-edge-focused strategy that concentrates computation along boundaries, maintaining fine-grained accuracy while reducing latency and computational cost. COORDFORMER achieves state-of-the-art performance on MaSS13K and outperforms comparably sized and higher-parameter methods on DIS5K and KPIs, demonstrating its effectiveness for high-quality, very-high-resolution semantic segmentation.

1. Introduction

Semantic Segmentation (SS) is a core problem in computer vision that aims to assign a semantic label to every pixel in an image, enabling dense understanding of visual scenes. Recent years have witnessed remarkable progress in SS, largely driven by deep learning techniques [33]. Most existing SS models, however, are designed and evaluated on standard-resolution datasets, typically around 1 megapixel [6, 10, 60]. Although several methods have explored high-resolution semantic segmentation [2, 29, 55], they are usually developed based on benchmarks such as Cityscapes [13] and ADE20K [70], where average image resolutions range from 1 to 4 megapixels and annotated masks exhibit limited structural complexity. Consequently, these approaches tend to overlook the challenges of very-high-resolution segmentation (> 4 Mpx) and often fail to capture thin structures or fine-grained details accurately, as highlighted in [59]. However, achieving finely detailed segmentation on very-high-resolution images is critical for numerous real-world applications, including image editing, augmented reality, and high-impact domains such as medical image analysis. To systematically study the problem, MaSS13K [59] was introduced at CVPR 2025 as a benchmark specifically designed to reveal the limitations of existing models in fine-grained, very-high-resolution semantic segmentation. Along with it, MaSSFormer [59] was proposed as an initial attempt to address the task and serve as a strong baseline for future research. Motivated by these findings, we take a step further and propose a new SS architecture, termed COORDFORMER, capable of addressing the challenging scenario set forth by MaSS13K. At its core lies a Coordinate Decoder [36, 46] equipped with a tailored Localized Cross-Attention mechanism. The decoder includes two complementary components: an MLP that processes spatial coordinates, and a ViT-style patch embedder that operates on small patches extracted from high-resolution images. Together, these modules generate coordinate-aware query tokens enriched with pixel-level, high-resolution details. These query tokens interact, through the proposed Localized Cross-Attention, with global tokens derived from a downsampled version of the entire image, which is processed by a Vision Transformer foundation model such as DINOv3 [45]. This interaction results in highly contextualized tokens, rich in semantic information while remaining aware of the fine-grained details present in the input image, enabling precise labeling at the queried spatial coordinates. Our novel framework offers several advantages. First, the coordinate-based strategy allows to predict labels only for a few selected pixels during inference, such as a particular region of interest, or to flexibly set the output resolution according to the target application. Consequently, our design allows explicit control over the computational cost at inference time, making it possible to choose the optimal trade-off between accuracy, efficiency, and memory constraints. This property stands in stark contrast to previous methods such as MaSSFormer [59], which require processing the entire input image and thus incur significant memory and computational overhead when handling very-high-resolution data. Indeed, MaSSFormer resizes all images to a fixed 12.6 Mpx resolution during inference, highlighting its limited flexibility in dealing with varying image scales. Furthermore, by leveraging the coordinate-based formulation, we introduce an efficient inference strategy. This approach focuses computation along semantic boundaries reducing inference time, while maintaining high accuracy on thin structures and fine details. Second, our coordinate-based decoding strategy, when coupled with a strong pre-trained foundation encoder, enables extremely precise predictions at the full very-high-resolution of the input images, as illustrated in Fig. 1. When evaluated on the challenging, finely detailed, very-high-resolution semantic segmentation task introduced by MaSS13K, COORDFORMER achieves state-of-the-art performance, surpassing existing approaches by a substantial margin. To further assess the precision of our predictions, we also evaluate COORDFORMER on the Dichotomous Image Segmentation (DIS) benchmark, DIS5K [39], where it outperforms both models of comparable size and higher-parameter ones, confirming its effectiveness in capturing fine-grained details. We additionally evaluate our method on the Kidney Pathology Image Segmentation benchmark (KPIs [16]), where it surpasses recent task-specific networks [17, 49] under the protocol [17]. This result confirms that our method transfers to a markedly different segmentation domain, even on the gigapixel-scale whole-slide images that characterize KPIs. The code is publicly available on GitHub. The main contributions of this paper are:

  • A novel Coordinate Decoder for very-high-resolution semantic segmentation, capable of producing highly detailed, spatially precise predictions.

  • A new Localized Cross-Attention mechanism tailored to our coordinate-based framework, enabling efficient integration of local and global information.

  • An efficient inference strategy, enabled by our coordinate-based formulation, that concentrates computation along semantic boundaries, dramatically reducing latency and cost while preserving accuracy.

  • We achieve state-of-the-art performance on MaSS13K and superior results on DIS5K and KPIs, demonstrating the generality of our method

References (69)

  • End-to-end object detection with transformers
  • Pem: Prototype-based efficient maskformer for image segmentation
  • Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs
  • Rethinking atrous convolution for semantic image segmentation (opens arXiv in a new tab)
  • Encoder-decoder with atrous separable convolution for semantic image segmentation
  • Collaborative global-local networks for memory-efficient segmentation of ultra-high resolution images
  • Vision transformer adapter for dense predictions
  • Per-pixel classification is not all you need for semantic segmentation
  • Masked-attention mask transformer for universal image segmentation
  • Cascadepsp: Toward class-agnostic and very high-resolution segmentation via global and local refinement
  • Twins: Revisiting the design of spatial attention in vision transformers
  • The cityscapes dataset for semantic urban scene understanding
  • Two decades of research
  • Vision transformers need registers
  • Advancing glomerular segmentation from patch- to slide-level
  • Muvit: Multi-resolution vision transformers for learning across scales in microscopy
  • An image is worth 16x16 words: Transformers for image recognition at scale
  • Rethinking bisenet for real-time semantic segmentation
  • Multi-scale high-resolution vision transformer for semantic segmentation
  • Segnext: Rethinking convolutional attention design for semantic segmentation
  • Advances in Neural Information Processing Systems, 36:29914–29934, 2023
  • Panoptic segmentation
  • Pointrend: Image segmentation as rendering
  • Segment anything
  • Improving semantic segmentation via decoupled body and edge supervision
  • Benchmarking detection transfer learning with vision transformers (opens arXiv in a new tab)
  • Refinenet: Multi-path refinement networks for high-resolution semantic segmentation
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Sparse refinement for efficient high-resolution semantic segmentation
  • Fully convolutional networks for semantic segmentation
  • Image segmentation using deep learning: A survey
  • Context-guided spatial feature reconstruction for efficient semantic segmentation
  • Transactions on Machine Learning Research, 2024
  • Deepsdf: Learning continuous signed distance functions for shape representation
  • Unite-divide-unite: Joint boosting trunk and structure for high-accuracy dichotomous image segmentation
  • High quality entity segmentation
  • Highly accurate dichotomous image segmentation
  • Vision transformers for dense prediction
  • U-net: Convolutional networks for biomedical image segmentation
  • Uhrnet: A semantic segmentation network specifically for ultra-high-resolution images
  • High quality segmentation for ultra high-resolution images
  • Feedformer: Revisiting transformer decoder for efficient semantic segmentation
  • DINOv3
  • Implicit neural representations with periodic activation functions
  • Gated-scnn: Gated shape cnns for semantic segmenta-tion
  • Fourier features let networks learn high frequency functions in low dimensional domains
  • Holohisto: End-to-end gigapixel wsi segmentation with 4k resolution sequential tokenization (opens arXiv in a new tab)
  • Deit iii: Revenge of the vit
  • Attention is all you need
  • Seaformer++: Squeeze-enhanced axial transformer for mobile visual recognition
  • Active boundary loss for semantic segmentation
  • Axial-deeplab: Stand-alone axial-attention for panoptic segmentation
  • IEEE transactions on pattern analysis and machine intelligence, 43(10):3349–3364, 2020
  • Pyramid vision transformer: A versatile backbone for dense prediction without convolutions
  • Pvtv2: Improved baselines with pyramid vision transformer
  • Unified perceptual parsing for scene understanding
  • Mass13k: A matting-level semantic segmentation benchmark
  • Segformer: Simple and efficient design for semantic segmentation with transformers
  • Pidnet: A real-time semantic segmentation network inspired by pid controllers
  • Bisenet v2: Bilateral network with guided aggregation for real-time semantic segmentation
  • Segfix: Model-agnostic boundary refinement for segmentation
  • Hrfformer: high-resolution transformer for dense prediction
  • Mp-former: Mask-piloted transformer for image segmentation
  • Pyramid scene parsing network
  • Icnet for real-time semantic segmentation on high-resolution images
  • Leveraging adaptive implicit representation mapping for ultra high-resolution image segmentation
  • Bilateral reference for high-resolution dichotomous image segmentation
  • Scene parsing through ade20k dataset
  • Dichotomous image segmentation with frequency priors