Abstract
Monocular Depth Estimation (MDE) is a fundamentally ill-posed problem where a single 2D image must be mapped to a 3D depth field. While humans utilize semantic cues and prior world knowledge to infer distance, most deep learning approaches treat MDE as a generic image-to-image translation task. This paper introduces ObjCAViT, a novel architecture that explicitly incorporates object-level semantics and spatial relationships. By integrating off-the-shelf object detectors (YOLOv7) and vision-language models (CLIP) through a cross-attention transformer module, ObjCAViT effectively resolves geometric ambiguities. Our approach achieves state-of-the-art competitiveness on the NYUv2 and KITTI benchmarks while maintaining a significantly smaller parameter footprint than massive transformer-based alternatives.
Introduction: The Challenge of Monocular Depth
Predicting 3D depth from a single 2D image is inherently ambiguous; a single pixel can represent a small object nearby or a large object far away. Humans overcome this by using "depth cues"—for instance, knowing the typical size of a car or understanding that a sink is usually positioned near a mirror. Traditional MDE models attempt to learn these geometric rules implicitly from raw pixels, which is often inefficient. ObjCAViT addresses this by explicitly feeding the model semantic and spatial information about the objects within a scene, bridging the gap between raw visual data and semantic world knowledge.
Methodology: The ObjCAViT Framework
The core of the proposed system is the Object Cross-Attention Vision Transformer (ObjCAViT) module. The architecture is built upon three primary pillars:
- Visual Encoder: A convolutional encoder-decoder based on EfficientNet-B5 extracts dense image features.
- Object Encoder: A frozen YOLOv7 detector identifies objects. For each detection, a WordNet definition of the label is processed through a frozen CLIP text encoder, providing a "semantic proxy" for world knowledge (e.g., the concept that a "refrigerator" is typically large and upright).
- ObjCAViT Module: This transformer-based component enables objects to "self-attend" to understand scene context and allows image patches to "cross-attend" to object features. A novel positional encoder incorporates bounding box dimensions (width and height), providing the model with explicit "apparent size" information—a critical cue for distance.
The final depth map is generated using an adaptive binning strategy, predicting depth as a linear combination of discrete depth "bins."
Experimental Setup
The model was evaluated on two gold-standard benchmarks for depth estimation:
- NYUv2: A dataset of indoor scenes (kitchens, bedrooms, etc.) captured with a Microsoft Kinect.
- KITTI: An outdoor driving dataset captured using LiDAR.
Results and Discussion
ObjCAViT consistently outperformed the AdaBins baseline across all standard metrics, including Absolute Relative Error (Abs Rel) and Root Mean Square Error (RMSE). On the NYUv2 dataset, the model achieved an Abs Rel of 0.103, matching or exceeding the performance of much larger and more computationally expensive models like DepthFormer and BinsFormer.
Key Insights
- Semantics as a Prior: Explicit object labels and definitions act as powerful constraints. Instead of guessing the nature of a shape, the CLIP embedding informs the model of the object's identity, allowing it to apply known size constraints.
- Apparent Size in KITTI: Including bounding box dimensions in positional embeddings was particularly effective for outdoor driving scenarios, where the relative size of vehicles and pedestrians is a highly reliable indicator of distance.
- Efficiency over Scale: ObjCAViT achieves competitive results with approximately 30M parameters, whereas many recent state-of-the-art models utilize over 200M parameters. This suggests that incorporating "smarter" semantic features is more effective than simply increasing model scale.
Conclusion and Future Work
While ObjCAViT demonstrates the power of semantic priors, it remains dependent on the accuracy of the underlying object detector. If the detector misses or mislabels an object, the cue becomes noise. Future research could explore integrating object features at multiple stages of the image encoding process and utilizing language models specifically fine-tuned for spatial reasoning. By moving beyond simple image-to-image translation, ObjCAViT provides a more robust, semantically-aware foundation for monocular depth estimation.
Summary updated