Guided Patch-Grouping Wavelet Transformer with Spatial Congruence for Ultra-High Resolution Segmentation

Deyi Ji, Feng Zhao, Hongtao Lu

Introduction

Ultra-high resolution (UHR) images—ranging from satellite imagery to medical histopathology—contain millions or even billions of pixels. Segmenting these images accurately is critical for applications like land-cover classification and lesion detection. However, UHR segmentation faces a persistent "memory-accuracy dilemma." Standard deep learning models cannot process full-resolution UHR images due to GPU memory constraints.

Existing approaches typically resort to two suboptimal strategies: downsampling the image, which sacrifices fine-grained local details, or cropping the image into patches, which loses the global context necessary for semantic consistency. While collaborative "global-local" methods attempt to bridge this gap, they often suffer from high computational overhead or spatial misalignment between the global and local views. To address these challenges, we introduce GPWFormer, a dual-branch framework that leverages a Guided Patch-Grouping Wavelet Transformer to achieve state-of-the-art performance with high memory efficiency.

Methodology

GPWFormer utilizes a hybrid architecture consisting of a CNN branch and a Transformer branch, designed to capture both category-wide context and high-frequency textures simultaneously.

Dual-Branch Architecture

  1. The CNN Branch ($\mathcal{C}$): This branch processes a downsampled version of the entire UHR image. Its primary role is to extract low-resolution, high-level semantic features that provide a "big picture" understanding of the scene.
  2. The Transformer Branch ($\mathcal{T}$): This branch operates on the full-resolution image. To maintain a manageable memory footprint, it partitions the image into patches. Unlike standard Transformers that treat patches in isolation or via rigid grids, this branch uses a novel grouping mechanism.

Guided Patch-Grouping

The most significant innovation in GPWFormer is the Guided Patch-Grouping mechanism. The model uses the semantic features from the CNN branch to guide the grouping of patches in the Transformer branch. Patches that share semantic similarities—even if they are spatially distant—are grouped together and processed by shared Transformer heads. This heuristic guidance allows the model to capture long-range dependencies without the quadratic computational cost of standard self-attention mechanisms applied to every pixel.

Wavelet Transformer (WFormer)

To further preserve detail, GPWFormer replaces traditional "lossy" downsampling methods (like max-pooling or strided convolutions) with Discrete Wavelet Transforms (DWT). Because DWT is mathematically invertible, it allows the model to reduce spatial dimensions for efficient computation while preserving the high-frequency information necessary for sharp segmentation boundaries. The inverse operation (IWT) is used during the restoration phase to ensure the final output retains fine-grained textures.

Spatial Consistency Congruence

A common failure mode in dual-branch models is spatial disagreement between the global and local streams. GPWFormer introduces a spatial congruence constraint to align the inter-patch relations between the CNN and Transformer branches. By employing a Taylor-series-approximated RBF kernel, the model ensures that both branches maintain a consistent understanding of object boundaries and spatial relationships during training.

Experimental Results

GPWFormer was evaluated across five diverse UHR benchmarks, spanning geospatial, urban, and medical domains: DeepGlobe, Inria Aerial, Cityscapes, ISIC, and CRAG.

Performance and Efficiency

The model achieved state-of-the-art (SOTA) results across all benchmarks. On the DeepGlobe satellite dataset, GPWFormer reached 75.8% mIoU, significantly outperforming previous leaders such as WSDNet (74.1%) and GLNet (71.6%). Similar gains were observed on Inria Aerial (76.5% mIoU) and Cityscapes (78.1% mIoU).

Crucially, these accuracy gains did not come at the cost of excessive memory usage. On the DeepGlobe dataset, GPWFormer required only 2380M of GPU memory, which is substantially lower than competing methods like FCtL (3167M) or CascadePSP (3236M). This efficiency makes GPWFormer a more viable candidate for practical deployment on standard hardware.

Conclusion

GPWFormer effectively resolves the memory-accuracy dilemma in UHR segmentation by combining the global context of CNNs with the local precision of Transformers. Through Guided Patch-Grouping and Wavelet-based feature extraction, the model captures complex dependencies and fine details without the prohibitive memory costs of traditional attention mechanisms.

While the current architecture relies on a ResNet-18 backbone, future work may explore integrating more modern, lightweight backbones to further lower the memory floor. Additionally, optimizing the multi-stage pyramid process for faster inference could enable real-time applications on edge devices. Overall, GPWFormer represents a significant step forward in the efficient processing of high-resolution visual data.

Summary updated

BibTeX
@inproceedings{ji2023guided,
  author = {Deyi Ji and Feng Zhao and Hongtao Lu},
  title = {{Guided Patch-Grouping Wavelet Transformer with Spatial Congruence for Ultra-High Resolution Segmentation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.24963/ijcai.2023/102},
}
Figure