NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning to Upsample by Learning to Sample

Wenze Liu, Hao Lu, Hongtao Fu, Zhiguo Cao

Introduction

Upsampling is a fundamental operation in deep learning-based dense prediction tasks, such as semantic segmentation, object detection, and depth estimation. The goal is to increase the resolution of feature maps while preserving or enhancing spatial information. Traditional methods like bilinear interpolation are computationally efficient but lack content awareness, often leading to blurred results. Conversely, state-of-the-art dynamic upsamplers like CARAFE, FADE, and SAPA offer content-aware capabilities but introduce significant computational overhead, often requiring custom CUDA kernels and high-resolution guidance images.

This paper introduces DySample, an ultra-lightweight dynamic upsampler that reformulates upsampling as a point sampling problem. By bypassing the heavy dynamic convolutions used in previous methods, DySample achieves superior performance with significantly reduced complexity and faster inference speeds, approaching the efficiency of standard bilinear interpolation.

Methodology

The primary innovation of DySample is the shift from kernel-based dynamic convolution to offset-based point sampling. Instead of generating unique kernels for every pixel, DySample predicts sampling offsets to determine where in the low-resolution feature map each high-resolution pixel should retrieve its value.

Offset Generation and Sampling

DySample utilizes a simple linear layer to generate x and y offsets. For an upsampling factor s, the model calculates the relative displacement for each point in the target high-resolution grid. The actual data movement is performed using the standard grid_sample function, which is highly optimized in modern deep learning frameworks like PyTorch. This design ensures the module is "plug-and-play" and requires no specialized hardware programming.

Key Design Choices

To ensure stability and performance, the authors implemented several critical design features:

  1. Bilinear Initialization: Rather than starting with random or zero offsets, DySample initializes sampling points in a bilinear distribution. This provides a strong baseline, allowing the network to learn meaningful refinements from the start.
  2. Scope Factor: To prevent sampling points from wandering too far—which can cause "checkerboard" artifacts or disordered boundaries—the authors introduced a "scope factor" (typically 0.25). This factor constrains the movement of sampling points within a localized region.
  3. Channel Grouping: To optimize memory usage, input channels are divided into groups (e.g., 4 or 8). Channels within the same group share the same sampling offsets, reducing the parameter count without sacrificing significant representational power.

Experimental Results

The effectiveness of DySample was evaluated across five major dense prediction tasks using standard benchmarks, including ADE20K (semantic segmentation), MS COCO (detection and segmentation), and NYU Depth V2 (monocular depth estimation).

Performance and Efficiency

DySample consistently outperformed or matched more complex dynamic upsamplers while maintaining a much smaller footprint:

  • Semantic Segmentation: On the ADE20K dataset using a SegFormer-B1 backbone, DySample achieved 43.58 mIoU, surpassing SAPA-B (43.20) and CARAFE (42.82).
  • Inference Latency: In 2x upsampling benchmarks, DySample recorded a latency of approximately 6.2ms, nearly twice as fast as CARAFE (~12.6ms) and over four times faster than SAPA (~27.8ms). For context, standard bilinear interpolation takes ~1.6ms.
  • Resource Utilization: When integrated into a MaskFormer-SwinB baseline, DySample provided a 46% greater performance improvement than CARAFE while utilizing only 3% of the parameters and 20% of the FLOPs (Floating Point Operations).

Discussion and Limitations

The results demonstrate that point sampling is a highly effective alternative to dynamic convolution. By moving the "sampling eyes" of the network rather than modifying the "convolutional filter," DySample achieves content awareness with minimal cost.

However, the authors noted a specific limitation: "guided" upsamplers (like FADE or SAPA) that utilize high-resolution reference images can sometimes produce sharper boundaries. This is because DySample operates solely on the low-resolution features, whereas guided models have direct access to high-resolution structural cues.

Conclusion

DySample represents a significant step forward in making dynamic upsampling practical for real-world deployment. Its "plug-and-play" nature, lack of custom CUDA requirements, and high efficiency make it a compelling choice for a wide range of computer vision architectures. Future research may extend this sampling-based philosophy to low-level vision tasks like image super-resolution or explore joint optimization of upsampling and downsampling modules.

Summary updated

BibTeX
@inproceedings{liu2023learning,
  author = {Wenze Liu and Hao Lu and Hongtao Fu and Zhiguo Cao},
  title = {{Learning to Upsample by Learning to Sample}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure