What Does Stable Diffusion Know about the 3D Scene?

Guanqi Zhan, Chuanxia Zheng, Weidi Xie, Andrew Zisserman

Abstract

Our objective in this paper is to probe large vision models to determine to what extent they 'understand' different physical properties of the 3D scene depicted in an image. To this end, we make the following contributions: (i) We introduce a general and lightweight protocol to evaluate whether features of an off-the-shelf large vision model encode a number of physical 'properties' of the 3D scene, by training discriminative classifiers on the features for these properties. The probes are applied on datasets of real images with annotations for the property. (ii) We apply this protocol to properties covering scene geometry, scene material, support relations, lighting, and view-dependent measures, and large vision models including CLIP, DINOv1, DINOv2, VQGAN, Stable Diffusion. (iii) We find that features from Stable Diffusion and DINOv2 are good for discriminative learning of a number of properties, including scene geometry, support relations, shadows and depth, but less performant for occlusion and material, while outperforming DINOv1, CLIP and VQGAN for all properties. (iv) It is observed that different time steps of Stable Diffusion features, as well as different transformer layers of DINO/CLIP/VQGAN, are good at different properties, unlocking potential applications of 3D physical understanding.

Introduction

Large Vision Models (LVMs)—including generative models like Stable Diffusion and discriminative ones like CLIP—have mastered 2D image tasks. However, because they are trained primarily on 2D pixel data, a fundamental question remains: Do these models actually "understand" the 3D physical world, or are they just high-dimensional pattern matchers? Understanding the 3D structure of a scene (e.g., knowing that a table supports a cup or identifying which surfaces are perpendicular) is crucial for robotics, augmented reality, and reliable image synthesis. This paper aims to systematically quantify this "hidden" 3D knowledge by probing the internal representations of these models.

Probing Protocol

The researchers introduce a general and lightweight probing protocol. Instead of retraining massive foundation models, they "freeze" them and extract features from various internal layers.

  1. Feature Extraction: For diffusion models, features are extracted at different noise "time steps" and U-Net layers. For transformer-based models (like DINO), different transformer blocks are analyzed.
  2. Linear Probing: Simple linear Support Vector Machines (SVMs) are trained to answer binary questions about pairs of regions in an image (e.g., "Is Region A deeper than Region B?").
  3. Symmetry Handling: Specific mathematical formulations are used for the SVM input. For symmetric relations (like "same plane"), the absolute difference between feature vectors is used. For asymmetric relations (like relative depth), the raw difference is used.
  4. Grid Search: A massive sweep identifies which specific layer and time step best encodes a particular physical property.

Experimental Setup

The study repurposes several standard computer vision datasets to create "probe" questions:

  • ScanNetv2: Scene geometry (identifying same or perpendicular planes).
  • DMS (Dense Material Segmentation): Material consistency.
  • NYUv2: Support relations (is A holding up B?) and relative depth.
  • SOBA: Lighting and shadow-object associations.
  • Separated COCO: Occlusion (identifying if two disconnected regions belong to the same occluded object).

Key Insights and Results

Stable Diffusion as a "Hidden" 3D Engine

Despite being a generative model, Stable Diffusion's internal features are remarkably good at predicting 3D layout and support relations. It isn't just "hallucinating" pixels; it's building them on a foundation of learned physics. Among non-generative models, DINOv2 significantly outperformed CLIP, suggesting that self-supervised vision tasks are better at forcing a model to learn spatial geometry.

Qualitative examples of inpainting demonstrating the model's ability to reconstruct scenes based on internal 3D knowledge.

Layer and Time Step Specialization

For Stable Diffusion, the third upsampling decoder layer ($D_3$) was consistently the most informative across almost all 3D properties. Layers too close to the input or output tended to be too noisy or too focused on low-level pixels. Furthermore, different stages of the denoising process specialize in different tasks: early time steps (low noise) are better for fine-grained details like depth, while mid-range time steps are better for high-level scene layout.

Performance Metrics

The researchers evaluated models using the Area Under the Curve (AUC) metric:

  • Geometry & Depth: Stable Diffusion and DINOv2 achieved near-perfect scores on depth (~99% AUC) and high scores on "same plane" detection (~96-97% AUC).
  • Support Relations: Both models showed strong performance (~92-93% AUC) in identifying support structures.
  • The Hard Stuff: All models struggled more with material consistency and occlusion (~81-84% AUC), indicating that semantic physical properties are harder to distill than geometric ones.

Conclusion and Future Work

To prove these features are useful, the authors injected the "probed" features into a state-of-the-art surface normal estimation model (iDisc), which resulted in improved accuracy. While the current protocol is limited to binary region-pair questions, future work could expand to complex multi-object reasoning and continuous physical values. This protocol could eventually be used to "audit" generated images—ensuring that synthetic scenes do not violate the 3D physical properties the models have implicitly learned.

Summary updated

BibTeX
@inproceedings{zhan2024what,
  author = {Guanqi Zhan and Chuanxia Zheng and Weidi Xie and Andrew Zisserman},
  title = {{What Does Stable Diffusion Know about the 3D Scene?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=0HRRNEAQFp},
}
Figure