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

SparseFormer: Attention-based Depth Completion Network

Frederik Warburg, Michaël Ramamonjisoa, Manuel López-AntequeraarXiv 2022 · DOI

Abstract

SparseFormer is a novel transformer-based architecture designed to solve the "very sparse" depth completion problem. By using a global attention mechanism, it can take a handful of scattered 3D points (like those generated by SLAM or SfM) and an RGB image to produce a high-quality dense depth map, significantly outperforming traditional convolutional methods when data is extremely limited or non-uniformly distributed.

Introduction

In applications like Augmented Reality (AR) and autonomous driving, systems often estimate their position by creating a map of sparse 3D landmarks using Structure from Motion (SfM) or SLAM. However, these landmarks are incredibly sparse—often covering less than 0.1% of the image—and are usually clustered in high-texture areas while leaving large gaps elsewhere. Furthermore, these points are prone to "outliers" (erroneous depth values caused by mismatched features).

Most existing depth completion research focuses on LiDAR data, which is much denser (~10%) and more uniformly distributed. Traditional Convolutional Neural Networks (CNNs) struggle with SfM landmarks because their local receptive fields make it difficult to "spread" information across the vast empty spaces between points. SparseFormer aims to bridge this gap by treating depth completion as a global interpolation problem.

Methodology

The authors introduce the SparseFormer module, which departs from standard convolutional layers in two major ways:

  1. Attention-based Interpolation: Instead of local kernels, the model computes an "attention volume" between visual features (from a standard encoder) and the sparse 3D landmarks. This attention matrix acts as a set of learned weights that determine how much each 3D point should contribute to the depth of any given pixel.
  2. Refinement Module: Before interpolation, the sparse points pass through a dedicated transformer block. This module allows the landmarks to "communicate" with each other. By looking at the collective geometry and visual context, the network can identify and effectively "filter out" outliers—points with incorrect depth values—by pushing their features away in the embedding space so they don't influence the final output.
The SparseFormer architecture overview, detailing the module structure and the refinement process.

Because the number of landmarks is typically small (around 300–500 points), the attention mechanism scales linearly with the image resolution ($O(HW \times N)$), making it computationally efficient compared to standard self-attention which scales quadratically ($O((HW)^2)$).

Experimental Results

The model was evaluated on two primary benchmarks: NYUDv2 (indoor) and Mapillary Planet-Scale Depth (MPSD) (outdoor). On NYUDv2, the authors emulated different levels of sparsity by sampling between 2 and 500 points. On MPSD, they used a real SfM pipeline (OpenSfM) to generate authentic, noisy, and non-uniform landmarks.

Performance at Low Densities

On the NYUDv2 dataset with only 32 points, SparseFormer achieved a Root Mean Square Error (RMSE) of 0.255, compared to 0.554 for the state-of-the-art convolutional method (NLSPN). Even with just 2 points in an entire image, SparseFormer produced a plausible depth map (REL 0.161), whereas convolutional baselines essentially failed (REL 0.300).

Qualitative results showing the attention mechanism's ability to produce dense predictions from sparse inputs.

Key Insights

  • Global vs. Local: For very sparse data, proximity in the image plane is a poor proxy for relevance. SparseFormer’s global receptive field allows it to find long-range dependencies, such as identifying that a 3D point on a distant wall is relevant to other pixels on that same wall.
  • Attention as a Natural Interpolator: The softmax-normalized attention scores naturally sum to one, making them mathematically well-suited to serve as interpolation weights for depth diffusion.
  • Robustness to Outliers: Qualitative results on the MPSD dataset show that the refinement module successfully prevents noisy SfM points from "bleeding" incorrect depth information into the surrounding scene.

Conclusion

SparseFormer demonstrates that global attention is a powerful tool for depth completion in extreme sparsity scenarios. By treating the problem as a global interpolation task rather than a local convolution task, the model effectively bridges large gaps in sparse data and remains robust to the noise inherent in SfM and SLAM systems. Future work may explore dynamic point counts or direct integration into active SLAM loops to guide landmark acquisition.

Summary updated

BibTeX
@misc{warburg2022sparseformer,
  author = {Frederik Warburg and Michaël Ramamonjisoa and Manuel López-Antequera},
  title = {{SparseFormer: Attention-based Depth Completion Network}},
  year = {2022},
  eprint = {2206.04557},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.04557},
}
Figure