SpatialVLM: Endowing Vision-Language Models with Spatial Reasoning Capabilities

Boyuan Chen, Zhuo Xu, Sean Kirmani, brian ichter, Danny Driess, Pete Florence, Dorsa Sadigh, Leonidas Guibas, Fei Xia

TL;DR

This paper introduces SpatialVLM, a novel framework that imbues Vision-Language Models (VLMs) with crucial 3D spatial reasoning capabilities. By generating a massive, internet-scale dataset of spatial Visual Question Answering (VQA) data, SpatialVLM significantly enhances VLMs' ability to understand and quantify spatial relationships, unlocking new applications in robotics and complex reasoning tasks.

What Problem Does This Paper Address?

Current state-of-the-art Vision-Language Models (VLMs), despite excelling in many visual understanding tasks, struggle with 3D spatial reasoning. This includes understanding object positions in 3D space, estimating distances, and recognizing size differences. The authors hypothesize that this limitation stems not from architectural constraints, but from a lack of sufficient 3D spatial knowledge in the training data. Existing datasets often focus on 2D information or lack the scale and richness needed to train robust spatial reasoning abilities, hindering VLMs' application in real-world scenarios like robotics and augmented reality.

Methods

The core of SpatialVLM is a data synthesis pipeline that automatically generates a large-scale 3D spatial VQA dataset. This pipeline leverages off-the-shelf computer vision models for:

  • Semantic Filtering: Using CLIP, the system filters out images unsuitable for spatial reasoning (e.g., single objects on plain backgrounds).
  • 2D Context Extraction: Object-centric segmentation, region proposal, and fine-grained captioning (using FlexCap) are employed to extract detailed information about objects within images.
  • Lifting 2D to 3D Contexts: Metric depth estimation (e.g., ZoeDepth) is used to transform 2D images into 3D point clouds, providing real-world scale. This is a key novelty, enabling metric spatial understanding.
  • Ambiguity Resolution: Techniques are used to ensure object captions are not ambiguous, either by augmenting them with spatial attributes or removing ambiguous cases.
  • Q&A Synthesis: Template-based generation creates millions of spatial VQA pairs, covering both qualitative (e.g., "is A to the left of B?") and quantitative (e.g., "how far is A from B?") questions.

The trained VLM (based on PaLM-E architecture) is then fine-tuned on this synthesized dataset.

Datasets

  • Training Data: A newly generated, internet-scale 3D spatial VQA dataset comprising 2 billion QA pairs from 10 million real-world images. This dataset is a significant contribution, aiming to overcome the limitations of existing datasets.
  • Evaluation Data: A manually annotated benchmark of 331 qualitative and 215 quantitative spatial VQA pairs derived from a subset of WebLI images. This benchmark is designed to stress-test the VLM's spatial reasoning capabilities.

Key Insights and Ideas

  • Data is Key: The primary hypothesis is that VLMs' spatial reasoning limitations are data-driven, not architectural. The success of SpatialVLM strongly supports this, showing that a large, diverse, and spatially rich dataset can significantly improve performance.
  • Lifting 2D to 3D is Crucial: The ability to transform 2D images into metric-scale 3D point clouds is a critical step for enabling quantitative spatial reasoning. This allows the model to understand real-world distances and sizes.
  • Fine-grained Captions Matter: Using flexible captioning methods like FlexCap to generate detailed object descriptions (e.g., "cake shaped like a house") rather than coarse categories (e.g., "cake") is essential for accurate spatial referencing.
  • Human-like Alignment: Post-processing answers to align with human rounding preferences (e.g., rounding 0.8m to 1m) makes the VLM's outputs more natural and practical.

Key Results

  • State-of-the-Art Performance: SpatialVLM achieved an accuracy of 75.2% on binary predicate prediction tasks, significantly outperforming baselines like GPT-4V (68.0%) and LLaVA-1.5 (71.3%).
  • Quantitative Accuracy: The model demonstrated a 99.0% success rate in outputting valid quantitative distance estimations, with results closer to ground truth than baselines. It achieved 8.4% accuracy in predicting values within a 0.9x to 1.1x range of human annotations.
  • Robotics Applications: SpatialVLM can serve as a dense reward annotator for robotics tasks, providing natural-language-queriable distance estimations that can guide robot control policies.
  • Chain-of-Thought Reasoning: When combined with an LLM, SpatialVLM can perform complex, multi-step spatial reasoning tasks, such as determining if objects form specific geometric shapes.

Limitations and Future Work

  • Dataset Bias: The authors acknowledge that the model's performance on distance estimation is influenced by the biases of the underlying depth estimation models, particularly for longer distances.
  • Noisy Data: While the model shows resilience to noisy quantitative answers, further investigation into handling noise is suggested.
  • Human Alignment Nuances: While human-like rounding is implemented, there's potential for more sophisticated alignment strategies.
  • Future Work: The paper suggests exploring more nuanced geometric primitives for deeper spatial grounding and investigating how to prompt VLMs to retain a specific number of digits for more precise distance estimations.

Summary updated

BibTeX
@inproceedings{chen2024spatialvlm,
  author = {Boyuan Chen and Zhuo Xu and Sean Kirmani and brian ichter and Danny Driess and Pete Florence and Dorsa Sadigh and Leonidas Guibas and Fei Xia},
  title = {{SpatialVLM: Endowing Vision-Language Models with Spatial Reasoning Capabilities}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  url = {https://openreview.net/forum?id=HgLB9NBPOW},
}
Figure