Abstract
Standard deep learning models for single-view depth estimation often fail to generalize when applied to cameras with different intrinsic parameters than those used during training. We present CAM-Convs (Camera-Aware Convolutions), a novel architectural modification that incorporates camera intrinsic parameters directly into convolutional layers. By concatenating camera-specific information as additional feature channels, our approach enables a single model to generalize across diverse hardware without the need for retraining or expensive data collection for every new device.
Introduction: The Generalization Gap in Depth Estimation
Recovering 3D structure from a single 2D image is a fundamental challenge in computer vision. While deep learning has significantly advanced monocular depth prediction, existing models suffer from a significant "generalization gap." A network trained on a specific dataset, such as NYUv2 (captured with a Microsoft Kinect), typically performs poorly on images from a smartphone or a wide-angle action camera.
This failure occurs because the geometric relationship between an object's pixel size and its actual depth is governed by the camera's intrinsics—specifically focal length, principal point, and sensor size. Standard convolutional neural networks (CNNs) are translation-invariant but "calibration-blind"; they cannot distinguish whether a small object is distant or simply captured with a short focal length. Currently, adapting to a new camera often necessitates collecting a new, costly RGB-D dataset.
Methodology: Camera-Aware Convolutions
To address this, we introduce CAM-Convs, which inject camera-specific geometric context into the network by concatenating extra channels to the input feature maps at multiple scales.
The core innovation lies in three specific types of coordinate maps:
- Centered Coordinates (cc): Two channels ($x$ and $y$) representing pixel coordinates centered at the camera's principal point. This informs the network of the lens center's position relative to the sensor.
- Field of View Maps (fov): Calculated as $fov = \arctan(\text{centered\_coordinates} / \text{focal\_length})$. These maps provide angular context for each pixel, effectively normalizing the scaling effects of different focal lengths.
- Normalized Coordinates (nc): Standard $[-1, 1]$ coordinate maps that provide general spatial context.
These channels are resized and injected throughout an encoder-decoder architecture (e.g., a ResNet-50 based U-Net), including within skip connections. This allows the network to learn "calibration-aware" patterns. Furthermore, we employ Focal Length Normalization to scale depth values during training to a "default" focal length, facilitating faster convergence.
Datasets and Evaluation
We evaluated our approach across several diverse datasets:
- 2D-3D Semantics Dataset: Used as a primary testbed where synthetic "virtual cameras" with varying focal lengths and sensor sizes were generated from equirectangular images to test controlled generalization.
- KITTI & ScanNet: Used to demonstrate the difficulty standard networks face when training on multiple image sizes and cameras simultaneously.
- NYUv2, MegaDepth, and Sun3D: Utilized for cross-dataset evaluation to prove real-world robustness.
Key Insights and Results
Our experiments reveal that CAM-Convs force the network to prioritize underlying geometric relationships over dataset-specific biases (e.g., assuming objects at the bottom of a frame are always closer). We found that Field of View (FOV) is a primary driver of depth estimation; by providing explicit FOV information, CAM-Convs allow the network to leverage wider visual cues more effectively.
Key results include:
- Superior Performance: In controlled experiments, CAM-Conv models trained on multiple cameras outperformed standard models trained on only a single camera when tested on that same camera.
- Zero-Shot Generalization: A CAM-Conv model trained on several datasets (excluding NYUv2) predicted depth on NYUv2 images with lower error and variance than state-of-the-art models specifically trained on NYUv2, particularly when camera parameters were shifted.
- Improved Sharpness: Qualitative analysis shows that CAM-Convs produce significantly sharper depth maps at geometric boundaries, such as room corners and edges, compared to standard convolutions.
Conclusion and Future Work
While CAM-Convs require camera intrinsics at test time (typically available in EXIF data), they offer a powerful solution for hardware-agnostic depth estimation. Future work could extend this "camera-aware" paradigm to other tasks where geometry is critical, such as 6D pose estimation or semantic segmentation.
Summary updated