SD-VLM: Spatial Measuring and Understanding with Depth-Encoded Vision-Language Models

NeurIPS 2025
Pingyi Chen1,2,3,    Yujing Lou3,4,    Shen Cao3,    Jinhui Guo3,    Lubin Fan3,   
Yue Wu3,    Lin Yang2,    Lizhuang Ma4    Jieping Ye3,   
1Zhejiang University     2Westlake University     3Alibaba Cloud     4Shanghai Jiao Tong University    
Teaser image.

SD-VLM Our work (1) proposes Massive Spatial Measuring and Understanding (MSMU) dataset with precise spatial annotations, and (2) introduces a plug-and-play depth positional encoding method strengthening VLMs’ spatial awareness.



Abstract

While vision language models (VLMs) excel in 2D semantic visual understanding, their ability to quantitatively reason about 3D spatial relationships remains under-explored, due to the deficiency of 2D images' spatial representation ability. In this paper, we analyze the problem hindering VLMs' spatial understanding abilities and propose SD-VLM, a novel framework that significantly enhances fundamental spatial perception abilities of VLMs through two key contributions: (1) propose Massive Spatial Measuring and Understanding (MSMU) dataset with precise spatial annotations, and (2) introduce a simple depth positional encoding method strengthening VLMs' spatial awareness. MSMU dataset covers massive quantitative spatial tasks with 700K QA pairs, 2.5M physical numerical annotations, and 10K chain-of-thought augmented samples. We have trained SD-VLM, a strong generalist VLM which shows superior quantitative spatial measuring and understanding capability. SD-VLM not only achieves state-of-the-art performance on our proposed MSMU-Bench, but also shows spatial generalization abilities on other spatial understanding benchmarks including Q-Spatial and SpatialRGPT-Bench. Extensive experiments demonstrate that SD-VLM outperforms GPT-4o and Intern-VL3-78B by 26.91% and 25.56% respectively on MSMU-Bench. We will release MSMU dataset and SD-VLM to facilitate future research in quantitative spatial measuring and understanding.



Dataset

Figure: Pipeline.

Starting from 3D scene point clouds, we first collect the spatial information (e.g., locations, sizes, relative distances) of objects in the scene to construct a scene graph. Next, we rasterize 3D instances into 2D images and establish a 3D-to-2D mapping, which enables transferring spatial annotations to images. We also perform filtering on both images and objects to ensure the quality of the QA pairs. Finally, we design human-verified QA templates and employ LLM collaboration to generate a rich set of QA pairs.

(step 1) Building Scene Graph. Given a 3D point cloud of a scene, we first construct a scene graph (stored as a JSON file) to systematically organize all annotations and metadata. This graph includes the object categorization and corresponding 3D spatial localization data which provides bounding boxes for each object, defined by centroid coordinates and dimensional parameters.

(step 2) Rasterize 3D instances to 2D images. We rasterize 3D instances onto images as masks using official tools. This process bridge an object in the 3D scene and 2D image plane, making transferring spatial annotations from 3D scene graph to each image feasible.

(step 3) Image Filtering and Object Selection. We first sparsely sample the RGB images to reduce redundancy. After that, we carefully select objects in each image, which is guided by three principal criteria: (1) Prevalence and functionality. We focus on objects demonstrating clear functional purposes which are commonly encountered in indoor environments. Architectural components (e.g., walls, ceilings) are excluded due to their limited interactive potential. (2) Instance visibility. Objects that are partially occluded (e.g., a chair mostly hidden behind a table), truncated by image borders (e.g., only a corner of a table is visible), or too small to annotate reliably (e.g., distant objects occupying fewer than 50 pixels) are excluded from our dataset. (3) Semantic disambiguation. Addressing linguistic ambiguity is important before generating annotations. For example, tables which exist in one image may vary in color or texture but are all labeled as "table", which brings noisy correspondence and finally misleads VLMs. To mitigate this issue, we resort to Qwen2.5-VL to re-label these objects with more detailed descriptions, such as "the white table" or "the wooden table". Finally, we filter out non-informative images that have no valid objects.

(step 4) Templated-based Generation. We carefully design a set of templates based on the task definitions which include various placeholders. For instance, one template for measuring the size of a single target object is structured as follows: ``Q: What is the size of [object A]. A: The size of [object A] is [Length]x[Width]x[Height].''} For each image, we enumerate the selected objects and replace these placeholders with the corresponding object labels or spatial annotations. In tasks involving two or more target objects, we also meticulously craft instructions that incorporate all relevant object labels and spatial information.

(step 5) Eliciting Reasoning Path with LLM collaboration. We improve the quantitative spatial ability of VLMs by eliciting reasoning paths with reference objects, we augment the QA pairs with CoT reasoning rationale via LLM collaboration. Specifically, we randomly select one object as the reference object and combine its spatial annotations along with the image as inputs to the advanced VLM, Qwen2.5-VL. The VLM is then prompted to construct a reasoning path that leverages the reference object to infer the spatial properties of another object within the image. Subsequently, we utilize a large language model, DeepSeek-V3, to assess and filter the CoT pairs by evaluating the factual consistency and logical coherence.

We employ this data generation pipeline to construct VQA pairs from ScanNet and ScanNet++. The resulting MSMU dataset contains 2K scenes, 25K images, 75K objects, 700K QA pairs, and 2.5M numerical values, covering a wide range of quantitative spatial tasks. Besides, the CoT augmented group, named MSMU-CoT, consists of 10K quantitative spatial reasoning QA pairs.



Model

Figure: Framework.

We introduce the depth positional encoding (DPE), which can encode the depth maps into depth positional embeddings, allowing for a straightforward combination through addition. We utilize sine and cosine functions of varying frequencies to generate the depth positional embeddings

The model consists of a vision encoder to encode image features, a depth encoding module to incorporate depth information, and a large language model to process sequences of tokens. When depth maps are not accessible during inference, we employ an external depth estimation model to generate the depth map. This allows our model to adapt to various datasets and scenarios effectively.



Results

Model Task Average
ExistenceObject
Counting
Scale
Est.
GroundingRelative
Position
Absolute
Distance
Scale
Comparison
Ref. Object
Est.
Large Language Models (LLMs): Text only
GPT-4-Turbo12.765.2113.5112.6424.847.5036.7912.0415.66
Qwen2.54.250.000.7813.790.620.0016.041.574.63
DeepSeek-V30.005.241.546.9010.560.0025.475.247.39
Vision-Language Models (VLMs): Image + Text
GPT-4o44.6841.673.8627.5967.0820.0054.722.0932.28
Gemini-238.3043.7523.9419.5454.6612.5069.8118.8535.17
Qwen2.5-VL-72B59.5735.421.5413.7957.762.5066.049.9530.82
Qwen2.5-VL-32B29.7941.6710.8118.3960.252.5046.2310.9927.59
Qwen2.5-VL-7B12.764.170.001.151.240.005.660.523.19
Intern-VL3-78B47.6242.716.4726.3256.9413.3364.1016.4633.63
Intern-VL3-8B36.1741.674.6318.3960.252.5049.068.3828.54
LLaVA-1.5-7B1.5436.465.0220.6942.865.0038.680.5219.45
Depth-encoded VLMs: Image + Depth + Text
SpatialBot10.6446.8815.8328.7466.465.0050.948.9029.17
SpatialRGPT10.6436.4620.0817.2460.2515.0062.269.9528.98
Ours 87.2347.9251.3542.5375.1640.0055.6646.0756.31
Ours w/ MSMU-CoT 87.2342.7151.7449.4373.2950.0069.8149.3259.19


Visualization

Figure: Visualization of responses from different models on MSMU-Bench.

In this work, we identified a critical gap in the ability of Vision-Language Models (VLMs) to perform quantitative spatial reasoning. To address this, we developed MSMU, a large-scale dataset comprising 700K QA pairs and 2.5M numerical physical annotations derived from real 3D scenes, designed to provide precise metric supervision for enhancing VLMs' spatial reasoning capabilities. We introduced a simple but effective depth positional encoding module that integrates the third dimension information into the VLM frameworks, effectively upgrading the model's spatial awareness from 2D to 3D. This innovation was shown to significantly enhance spatial reasoning abilities, outperforming both RGB-only VLMs and depth-encoded VLMs. We anticipate that our contributions will pave the way for further advancements in VLMs' spatial reasoning capabilities, enabling more effective operation in real-world environments.



BibTeX

@InProceedings{chen2025sdvlm,
    author = {Pingyi Chen, Yujing Lou, Shen Cao, Jinhui Guo, Lubin Fan, Yue Wu, Lin Yang, Lizhuang Ma, Jieping Ye},
    title = {SD-VLM: Spatial Measuring and Understanding with Depth-Encoded Vision-Language Models},
    booktitle = {NeurIPS},
    year = {2025}
}