Manuscript Offprint
arXiv:2610.38587RoSAMDepth: Robust Self-supervised Depth Estimation Leveraging Segment Anything Model
Abstract
Robust depth estimation aims to maintain high-quality depths across diverse conditions. However, most existing methods estimate depth without taking into account the object-level information. As a result, the predicted depth may easily deviate within objects and become blurred under adverse conditions. To overcome this weakness, we propose RoSAMDepth, a novel framework that can assist robust self-supervised depth estimation in leveraging rich and diverse object-level priors from the Segment Anything Model (SAM). We focus on incorporating object-level information across three key aspects: a segment-guided representation contrasting method that injects object-level awareness into the feature representation space; an adaptive regional outlier masking strategy combined with a regional Gaussian likelihood loss that enforces regional depth smoothness; and an object-level reliability estimation strategy that mitigates the influence of unreliable supervision. Extensive experiments across multiple datasets and diverse weather conditions demonstrate that our method produces sharper, more accurate depth predictions, consistently outperforming state-of-the-art methods. Our code is available at https://github.com/xagao/RoSAMDepth.
1. Introduction
Monocular depth estimation is a fundamental task in computer vision, crucial for downstream applications, such as autonomous driving, robotics, and AR/VR. Supervised methods [1, 5, 15, 17, 26] achieve high accuracy but rely on expensive ground-truth (GT) depths for training. To alleviate this dependency, self-supervised methods leverage geometrical constraints from stereo pairs or monocular videos to learn depth estimation without explicit annotations [2, 7, 8, 11, 22, 36, 40, 43].
Corresponding Author: Wei Liu

Figure 1. Our RoSAMDepth utilizes object-level information from SAM [14] to generate sharp and accurate depths across diverse conditions.
Despite their success under standard daytime conditions, self-supervised methods often degrade in challenging conditions such as nighttime or adverse weather [7, 21, 28, 37], where the photometric consistency breaks. Early works address a specific condition (e.g., nighttime), using adversarial learning or feature disentanglement for domain representations [18, 30, 32]. Recent methods [7, 21, 28, 37] focus on unified robustness across diverse degradations by synthesizing paired data with teacher-student learning or further adapting synthetic-trained teachers to real degraded data.
However, existing methods typically treat degraded regions uniformly, without considering the semantic or object-level differences that significantly influence visual perception and depth estimation. As shown in Fig. 1, ignoring object-level priors can lead to blurred depth boundaries and unstable predictions under complex environments or diverse conditions. To better estimate depth across diverse real data, it is important to understand the object spatial relationships and assess the reliability of depth cues. Meanwhile, the predicted depth should also be smooth only within the same continuous object region, while allowing sharp depth boundaries near object edges. Thus, incorpo-rating object-level information is key to refining robust self-supervised depth estimation under adverse conditions.
Indeed, prior methods exploit semantic segmentation to incorporate object information for depth estimation under standard conditions [12, 19]. However, semantic segmentation is inherently limited, as it cannot distinguish instances within the same class, which may have drastically different depths. It is also constrained by a limited set of predefined classes, often failing to recognize novel objects in the open world. Moreover, segmentation models trained on specific domains or weather conditions generalize poorly across diverse scenarios. In comparison, the Segment Anything Model (SAM) [14] offers a better option. SAM is a general-purpose image segmentation model pre-trained on massive and diverse datasets. It separates individual instances and demonstrates strong zero-shot robustness to unseen objects and various weather conditions [14, 25, 29].
Building upon these advantages, we propose to integrate SAM for additional object-level information to enhance robust self-supervised depth estimation. Our framework jointly improves feature representation and depth learning. Specifically, for representation learning, we propose segment-guided representation contrasting (SRC) that exploits SAM masks for implicitly embedding object-level structural awareness into the feature space. Furthermore, to improve supervision for depth learning, we identify key limitations in the conventional smoothness loss and the pixel-level pseudo-label quality indicator. In response, we introduce two strategies: an adaptive regional outlier masking (AROM) strategy paired with a regional Gaussian likelihood loss to rectify inconsistent depth outliers; and an object-level reliability estimation (ORE) strategy that mitigates the influence of unreliable supervision signals. Our method significantly outperforms previous methods in diverse conditions through different real-world datasets [3, 20]. In summary, our contributions are as follows:
• To the best of our knowledge, we are the first to effectively integrate SAM into robust self-supervised depth estimations, using only pre-generated SAM masks during the training as object-level priors.
• We propose three novel designs to take full advantage of SAM's object-level priors: segment-guided representation contrasting (SRC), adaptive regional outlier masking (AROM) strategy combined with a regional Gaussian constraint, and object-level reliability estimation (ORE) strategy. These components provide efficient guidance to train the model and lead to improved depth.
• Extensive experiments on the nuScenes [3] and Oxford Robotcar [20] benchmarks demonstrate that our method consistently outperforms state-of-the-art approaches, delivering sharper and more accurate depth under diverse real-world conditions.
2.1. Self-supervised Monocular Depth Estimation
Self-supervised monocular depth estimation methods use multi-view images for training and learn to estimate the depth from a single input image with photometric reconstruction consistency as supervision. SfM-Learner [43] firstly introduces an unsupervised paradigm that relies on photometric consistency, formulating depth estimation as a view synthesis task. Monodepth2 [8] introduces the per-pixel photometric loss with an auto-mask and a full-resolution sampling for training the model to reduce the impact of moving objects. Several methods [4, 9, 12, 19] use extra semantic information to improve performance, and the frameworks explored in [16, 38] jointly learn depth, camera pose, and optical flow. Additionally, the multi-frame monocular depth estimation is handled in [10, 36], which predicts more accurate depths by taking two frames of a monocular video as the input.
2.2. Depth Estimation under Adverse Conditions
Robust depth estimation under adverse conditions, such as rain, night, and fog, remains challenging and actively studied. Early approaches focus on nighttime. DeFeat-Net [30] jointly learns depth and cross-domain features, ADIDS [18] utilizes a generative adversarial network (GAN) to generate paired nighttime images and splits features into private and invariant sub-spaces, and ADFA [32] employs a GAN-based discriminator with adversarial training to align nighttime and daytime features. Later methods like RNW [35] and STEPS [41] integrate image enhancement to improve depth quality, and WSGD [33] combines denoising with a lighting change decoder to predict per-pixel changes.
More recent methods extend beyond nighttime to tackle multiple conditions by exploiting generative techniques such as GANs and diffusion models [27, 39, 42, 44]. Md4all [7], Robust-Depth [28], and WeatherDepth [34] enhance robustness through GAN-based weather augmentations integrated into teacher-student frameworks. Complementary to these approaches, DM-MDE [31] incorporates stable diffusion priors, and Syn2RealDepth [37] proposes an auxiliary space and a real adaptation stage. Our key insight is that the fidelity of synthetic-to-real adaptation can be significantly improved with explicit object-level guidance. We operationalize this by incorporating cues from SAM, which enhance depth estimation in two ways: 1) enabling the model learning object-aware perception, and 2) providing object-level priors for supervision signals refinement.
3. Method
We target accurate and realistic depth estimation across various conditions, including both standard (e.g., daytime) and adverse conditions (e.g., rain, nighttime, etc.). Our

Figure 2. Illustration of the proposed method. Given the SAM masks, we leverage object-level priors to improve depth estimation in two complementary ways: 1) Object-aware representation learning: SRC injects segment priors into multi-scale features. 2) Depth learning with object-level priors, AROM generates an outlier-suppressed mask , which is paired with to enforce consistent depth within each region. Concurrently, ORE estimates object-level reliability to form a reliability-weighted map , combined with to modulate the distillation loss .
pipeline, illustrated in Fig. 2, is built around two main objectives: 1) learning object-aware representation, and 2) improving depth learning signals with object-level priors. To achieve the first objective, we propose segment-guided representation contrasting (SRC), which enables the depth network to implicitly learn the concept of segmentation at the feature level (Sec. 3.2). To realize the second objective, we introduce two key strategies: an adaptive regional outlier masking (AROM) strategy, which is combined with a regional Gaussian likelihood loss to enforce object-aware depth smoothness, and an object-level reliability estimation (ORE) strategy to focus self-supervision on reliable regions (Sec. 3.3). The training of the teacher depth network () is detailed in Sec. 3.1.
3.1. Preliminaries
Self-supervised Depth Estimation Given a target image and an adjacent source frame , self-supervised monocular depth estimation learns to predict a dense depth map for . Instead of ground-truth labels, supervision is provided by a photometric reprojection loss that measures the consistency between and its reconstruction , obtained by warping using
the predicted and the estimated relative pose.
Robust Teacher Depth We build upon the synthetic-to-real training paradigm introduced in [37], which consists of a synthetic adaptation stage followed by a real adaptation stage. Our improvements focus on the real adaptation stage, where the model encounters the challenges of real-world data. Following [37], we use the depth network trained on the synthetic stage as a fixed teacher network, denoted as in our framework. For clarity, the initial synthetic adaptation stage and the pose network training, which remain unchanged from [37], are omitted from Fig. 2.
SAM Mask Generation We leverage SAM to generate object-level information without any fine-tuning. For each input image , we run SAM in its 'segment-everything' mode to produce a set of binary masks, . To obtain a partition of non-overlapping object-level segments, we apply a post-processing step: each pixel is assigned to the mask with the largest area among all candidate masks in that contain it. This generates the final masks , where is the number of non-overlapping object-level regions and denotes the -th region. All SAM masks are pre-generated before training, ensuring that
SAM is only used offline. Additional details are provided in the supplementary material.
3.2. Object-Aware Representation Learning
To inject object-level awareness into the depth network, we introduce segment-guided representation contrasting (SRC). Our SRC transfers segmentation priors from SAM through a regional prototype-based contrastive approach. It aims to encourage the depth network to infer geometric coherence, ensuring that pixels within the same segment are assigned structurally consistent depths. Specifically, SRC exploits SAM from a clustering perspective, contrasting the features of the depth network according to the given segments of the SAM.
A key design choice of SRC is to perform the contrasting at the feature level rather than imposing direct constraints on the final depth. This is because SAM tends to over-segment a single object into multiple parts, and enforcing depth discontinuities at every segment boundary could lead to erroneous supervision. Instead, by transferring segmentation priors into the depth decoder's feature space, SRC allows the network to implicitly learn object-aware representations without explicitly altering the depths.
Fig. 2 illustrates the proposed SRC. The depth decoder produces a pyramid of multi-scale features. To incorporate segmentation cues into each decoder stage, we first resize the SAM masks using nearest interpolation to match the resolution of each feature level, denoted as . At each scale s, we generate a prototype for each segment by averaging the features of the pixels located on the segment:
where denotes the feature at position in scale s, and is the prototype of the ith segment. Note that we normalize the features/prototypes along the channel dimension before and after averaging, to ensure they are constrained to lie on the unit hypersphere.
Then, we enforce each pixel feature to be close to the prototype of the segment it belongs to and distant from the prototypes of other segments. This contrastive objective encourages features within the same segment to form compact clusters, enabling the depth network to learn object-aware representations that lead to more consistent depth predictions. We formalize this contrasting process with the InfoNCELoss [23] as:
where S is the number of feature scales, N is the total number of segments in the , and T is the temperature.

Figure 3. An example of why conventional boundary-aware smoothness loss performs poorly. (a) Original image. (b) Depth from overlaid with the SAM boundary (black). (c) Weak and local gradients of the conventional boundary-aware smoothness loss. (d) Our outlier-suppressed mask. (e) Strong, non-local gradients from our proposed regional Gaussian likelihood loss guided by the outlier-suppressed mask.
3.3. Depth Learning with Object-Level Priors
To further enhance the quality of predicted depth, we leverage object-level priors to improve depth learning signals. First, we propose to achieve object-aware smoothness by combining an adaptive regional outlier masking (AROM) strategy with a regional Gaussian likelihood loss. This combination suppresses intra-region outliers and maintains regional smoothness. Second, we develop an object-level reliability estimation (ORE) strategy for pseudo-label reweighting, which assesses depth reliability at the object level rather than the pixel level. These components together enforce region-consistent supervision and substantially improve the depth quality in diverse conditions.
Object-aware Smoothness. This adaptation of the supervision signal comes from the motivation that object segmentation can be used to formulate a more precise smoothness constraint, thereby better regularizing the depth map. We begin by discussing the shortcomings of the conventional smoothness loss and then show how we mitigate those limitations with the help of SAM.
Limitations of previous smoothness losses. Most existing methods define smoothness loss using first-order depth derivatives [7, 8, 36, 43]. Given mean-normalized inverse depth , the conventional smoothness loss is:
in which serves as the edge-aware weights to avoid penalties across object boundaries, where depth is not necessarily continuous. Such weights are usually derived from the image edges, which often coincide with object boundaries [8, 43]. However, the inherent limitations of the boundary-aware smoothness loss prevent it from leveraging more accurate object boundaries.
One example is illustrated in Fig. 3. As shown in Fig. 3b, the depth estimation fails around people, resulting in blurred depth and erroneously predicting part of the background building as a continuous foreground. In this case, the gradient of the boundary-aware smoothness loss mostly arises near the depth boundary (Fig. 3c), since the loss mainly focus on where the image is smooth ( is large) and the depth exhibits discontinuity ( is large). However, in regions where the depth is incorrectly estimated but locally smooth (e.g., mispredicted background between the object boundary and the erroneous depth boundary), the loss incorrectly assumes depth continuity ( is small) and fails to respond, resulting in weak gradients confined to a limited neighborhood around the depth boundary.
Regional smoothness based on segment. To address this limitation, we extend the smoothness formulation from object boundaries to object regions. Intuitively, the inaccurate depth values in Fig. 3b can be understood as regional outliers within the same object (background building). To achieve regional smoothness, we introduce an adaptive regional outlier masking (AROM) strategy together with a regional Gaussian likelihood loss. Specifically, AROM computes an outlier-suppressed mask that filters out depth outliers based on intra-object geometric consistency. To obtain , for each object , we first calculate the mean and standard deviation of the inverse teacher depth . Then we compute a dense deviation map , where each pixel's normalized deviation from its regional mean is obtained by:
A fixed threshold on to identify outliers is suboptimal, as a small value tends to misclassify large but structurally consistent depth variations (e.g., ground or building surfaces) as outliers, while a large one fails to detect the outliers in homogeneous regions. We therefore introduce an adaptive threshold that adjusts dynamically to each object's intrinsic depth variability. It relaxes the outlier criterion in high-variance regions (large ) while enforcing a stricter one in homogeneous regions (small ):
where is a base threshold and controls the sensitivity. The outlier-suppressed mask is generated by comparing deviation with the region-specific threshold :
where is the sigmoid function and is a temperature-controlled sharpening sigmoid that enhances the transition around 0.5. The resulting assigns low values to depth outliers (Fig. 3d).
With , we introduce a regional Gaussian likelihood loss, which models the inverse teacher depth within each segment as a Gaussian distribution characterized by and . The loss encourages the inverse student depth

(a) Image patch
(b) Scaled depths
(d) Pixel-level photometric error
(c) Selected depth
(e) Object-level Reliability
Figure 4. Pixel-level photometric error is insufficient for evaluating the object-level depth reliability. (a) Image patch. (b) Depth predictions from , with the car's depth scaled from 0.25 to 4.0. (c) The corresponding photometric error map, where brighter intensity denotes larger error, fails to capture the object-level depth reliability. (d) Depth map obtained by selecting, for each pixel, the scaled depth that minimizes the pixel-level photometric error. (e) Our object-level reliability correctly identifies the entire mis-predicted car as an unreliable region.
intra-region smoothness by penalizing depth deviations from local statistics:
By weighting the loss with , the supervision is concentrated on outliers. This formulation results in strong gradients on outlier regions (Fig. 3e) that enforce depth smoothness. Importantly, plays a dual role: it not only guides , but also suppresses outlier-induced error propagation in the depth distillation loss (Eq. (10)).
Object-Level Reliability. A widely adopted strategy for evaluating the reliability of pseudo-labels is to compute the pixel-wise photometric error [21, 28], assuming that low local errors correspond to trustworthy predictions. However, this local metric is misaligned with the nature of depth reliability, which typically exhibits strong object-level spatial correlations. As illustrated in Fig. 4b and d, scaling the depth of a car by different factors results in only localized deviations of the indicator (photometric error in Eq. (8)), while the interior region remains falsely reliable. This is because pixels within the same object often share similar appearances, leading to chance alignments even when the object's depth is mispredicted. Consequently, pixel-level evaluation identifies only scattered unreliable pixels and fails to capture object-level unreliability.
Furthermore, when selecting depths corresponding to the lowest indicator values as in [21, 28], many depths on incorrectly scaled factors are still considered trustworthy, producing incorrectly selected depths (see Fig. 4c). These findings reveal the inherent insufficiency of pixel-level indica-tors and motivate us to shift the focus from individual pixel evaluation to object-level reliability estimation. We define this as the object-level reliability estimation (ORE) strategy, which aims to assess the reliability of pseudo-labels within each object region for more effective supervision signals.
Our approach begins by calculating the pixel-wise photometric error (pe) following [8, 21, 28]:
where and denote the target and reconstructed source images. We then exploit SAM masks to aggregate these pixel errors into a mean photometric error for each segment , following the same averaging rules as in Eq. (1). To obtain the final object-level reliability estimation, we compute the mean photometric error for the entire image and derive an object-level reliability map R by comparing each object's error with :
where is a scaling factor. To apply object-level reliability to the pixel-wise supervision, we construct a reliability-weighted map , where is a weight bias to ensure weak supervision, while preserving the relative emphasis on more reliable regions. Intuitively, as shown in Fig. 4e, objects whose errors deviate significantly from the global are assigned lower reliability.
With and , we define our robust depth distillation loss as:
where and represent the depth predicted by and , respectively. denotes the consistency reweighting map from the baseline model [37]. The final training loss can be defined as:
where denotes the auxiliary losses adopted from [37], and more details are shown in supplementary.
4. Experiments
4.1. Implement Details
Both our teacher and student depth networks adopt the same architecture [36] as in [37]. In our implementation, we use the pretrained teacher model provided by [37], which is trained on synthetic data, without any fine-tuning. The student network is initialized from the teacher and trained for 10 epochs following [37]. The model is implemented in PyTorch [24] and optimized using Adam [13] with a batch size of 10. The learning rate is initialized to and decayed by a factor of 0.5 every 5 epochs. For the Segment Anything Model [14], we use the off-the-shelf default ViT-H pretrained model. Additional implementation details are provided in the supplementary material.
4.2. Dataset and Evaluation Metric
We evaluate our method on the nuScenes [3] and Oxford Robotcar [20] datasets and follow the same training data schedules as [37]. NuScenes [3] is a comprehensive benchmark with real driving data under daytime, nighttime, and rainy conditions. In our experiments, we utilize 21,476 images for training, including 15,129 daytime, 3,796 rainy, and 2,551 nighttime frames. The evaluation set consists of 6,019 consecutive frame pairs: 4,449 daytime, 1,088 rainy, and 602 nighttime. We report results in both single-frame and multi-frame settings, and all metrics are computed for ground truth within 0.1–80 m. For the Oxford RobotCar [20] dataset, following WSGD [33], we use 17,790 daytime and 19,162 nighttime images for training, and 1,411 single images for testing (702 daytime images and 709 nighttime images). Evaluation is performed under the single-frame setting, with metrics computed within 0.1–50 m.
We employ commonly adopted metrics [7, 8, 31, 35, 37] for depth estimation, including absolute relative error (AbsRel), root mean square error (RMSE), squared relative error (SqRel), and threshold accuracy ( ).
4.3. Quantitative Results
Our quantitative testing results across different datasets are shown in Tabs. 1 and 2. Our method significantly outperforms state-of-the-art unsupervised methods on both nuScenes [3] and Oxford Robotcar [20] datasets on almost all evaluation metrics. On the nuScenes dataset [3], which covers diverse conditions including day-clear, night, and day-rain. Following [37], we evaluate both single-frame (identical inputs) and multi-frame (temporally adjacent inputs) settings. Our method consistently demonstrates superior performance across almost all metrics and conditions. Compared with recent methods trained on synthetic data [7, 31], our method significantly outperforms them. When compared to the real-data-trained method [37], our model achieves consistent improvements across almost all metrics under both single-frame and multi-frame settings, with average relative gains of 2.8%, 2.7%, 0.6%, and 0.9% on AbsRel, SqRel, RMSE, and , respectively, averaged over all conditions and both single- and multi-frame settings.
In Tab. 2, we present a comparative analysis on the Robotcar dataset [20], evaluating the performance of previous methods against our method. Since the Oxford Robotcar test set contains only single-frame samples, we evaluate under the single-frame setting. Our method achieves substantial improvements of 4.4%, 7.6%, 4.7%, 0.9% on AbsRel, SqRel, RMSE, and , respectively, compared with [37]. These results demonstrate the effectiveness of our method, which leverages SAM priors to improve the depth quality and robustness in self-supervised depth estimation under diverse conditions.
| Method | Test frames | day-clear – nuScenes | night – nuScenes | day-rain – nuScenes | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | ||
| Monodepth2 [8] | 1 | 0.1333 | 1.820 | 6.459 | 85.88 | 0.2419 | 2.776 | 10.922 | 58.17 | 0.1572 | 2.273 | 7.453 | 79.49 |
| R4Dyn† (Radar) [6] | 1 | 0.1259 | 1.661 | 6.434 | 86.97 | 0.2194 | 2.889 | 10.542 | 62.28 | 0.1337 | 1.938 | 7.131 | 83.91 |
| RNW [35] | 1 | 0.2872 | 3.433 | 9.185 | 56.21 | 0.3333 | 4.066 | 10.098 | 43.72 | 0.2952 | 3.796 | 9.341 | 57.21 |
| robust-depth [28] | 1 | 0.1436 | 1.862 | 6.802 | 82.95 | 0.2101 | 2.691 | 8.673 | 69.58 | 0.1458 | 1.891 | 7.371 | 80.21 |
| md4all-AD [7] | 1 | 0.1523 | 2.141 | 6.853 | 83.11 | 0.2187 | 2.991 | 9.003 | 68.84 | 0.1601 | 2.259 | 7.832 | 78.97 |
| md4all-DD [7] | 1 | 0.1366 | 1.752 | 6.452 | 84.61 | 0.1921 | 2.386 | 8.507 | 71.07 | 0.1414 | 1.829 | 7.228 | 80.98 |
| DM-MDE [31] | 1 | 0.1280 | - | 6.449 | 84.03 | 0.1910 | - | 8.433 | 71.14 | 0.1390 | - | 7.129 | 81.36 |
| Syn2Real-Depth [37] | 1 | 0.1239 | 1.454 | 6.214 | 85.66 | 0.1792 | 1.896 | 7.949 | 71.08 | 0.1331 | 1.616 | 6.926 | 81.68 |
| Ours-Single | 1 | 0.1172 | 1.357 | 6.121 | 86.13 | 0.1742 | 1.865 | 7.966 | 72.52 | 0.1298 | 1.612 | 6.801 | 82.30 |
| Manydepth [36] | 2(-1,0) | 0.1213 | 1.699 | 6.183 | 87.05 | 0.2442 | 3.347 | 11.38 | 57.04 | 0.1347 | 1.730 | 7.110 | 81.24 |
| Syn2Real-Depth [37] | 2(-1,0) | 0.1170 | 1.371 | 6.023 | 86.66 | 0.1713 | 1.779 | 7.689 | 73.16 | 0.1266 | 1.532 | 6.654 | 82.86 |
| Ours-Multi | 2(-1,0) | 0.1131 | 1.281 | 5.992 | 86.95 | 0.1667 | 1.775 | 7.729 | 73.95 | 0.1236 | 1.521 | 6.613 | 83.53 |
Table 1. Quantitative comparison on nuScenes [3] under different conditions (day-clear, nighttime, and day-rain). † denotes the method [6] that leverages additional Radar information. 'Test frames' specifies whether the evaluation is conducted in a multi-frame or single-frame setting. The best and the second best results are highlighted in bold and underline, respectively.
| Method | Test frames | day – Robotcar | night – Robotcar | ||||||
|---|---|---|---|---|---|---|---|---|---|
| AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | ||
| Monodepth2 [8] | 1 | 0.1209 | 0.723 | 3.335 | 86.61 | 0.3909 | 3.547 | 8.227 | 22.51 |
| DeFeatNet [30] | 1 | 0.2470 | 2.980 | 7.884 | 65.00 | 0.3340 | 4.589 | 8.606 | 58.60 |
| ADIDS [18] | 1 | 0.2390 | 2.089 | 6.743 | 61.40 | 0.2870 | 2.569 | 7.985 | 49.00 |
| RNW [35] | 1 | 0.2970 | 2.608 | 7.996 | 43.10 | 0.1850 | 1.710 | 6.549 | 73.30 |
| WSGD [35] | 1 | 0.1760 | 1.603 | 6.036 | 75.00 | 0.1740 | 1.637 | 6.302 | 75.40 |
| robust-depth [28] | 1 | 0.1225 | 0.776 | 3.302 | 85.84 | 0.1333 | 0.895 | 3.756 | 85.11 |
| md4all-DD [7] | 1 | 0.1128 | 0.648 | 3.206 | 87.13 | 0.1219 | 0.784 | 3.604 | 84.86 |
| DM-MDE [31] | 1 | 0.1190 | 0.728 | 3.287 | 87.17 | 0.1290 | 0.751 | 3.661 | 83.86 |
| Manydepth [36] | 1 | 0.1200 | 0.802 | 3.413 | 87.46 | 0.4974 | 5.517 | 10.21 | 14.87 |
| Syn2Real-Depth[37] | 1 | 0.1063 | 0.646 | 3.171 | 88.29 | 0.1103 | 0.693 | 3.455 | 86.15 |
| Ours-Single | 1 | 0.1006 | 0.595 | 3.022 | 88.90 | 0.1066 | 0.643 | 3.291 | 87.03 |
Table 2. Quantitative comparison on the Robotcar [20] test set under daytime and nighttime conditions.
4.4. Qualitative Experimental Results
Our qualitative results across various adverse conditions are shown in Fig. 5. As the Oxford Robotcar dataset already includes clear day scenes, we omit the day-clear cases from nuScenes and show representative samples from both datasets. More qualitative examples are available in the supplementary material. Since DM-MDE [31] is unavailable, we compare with the latest methods [7, 37]. Under the day-rain condition (nuScenes, Row1), images often exhibit low contrast and texture degradation, leading md4all [7] and Syn2Real-Depth [37] to blur object boundaries. In contrast, our method maintains sharper structures and accurately recovers the spatial relationships among objects. Under the clear daytime condition (Oxford Robotcar, Row 3), our method predicts high-quality depth consistent with scene geometry, producing accurate depth for the car and finer delineation of poles and street signs. Nighttime scenes pose additional challenges, such as limited illumination (nuScenes, Row 2) and strong glare (nuScenes, Row 4). Competing methods often fail to recover consistent and sharp depth in these cases. However, our method effectively preserves depth consistency and boundary sharpness, suppresses reflection-induced artifacts, and clearly de-
fines the foreground while accurately capturing the depth of the more distant vehicles. These visual comparisons highlight our framework's robustness across diverse illumination and weather conditions, particularly in preserving object boundaries and maintaining depth consistency under different challenging scenes.
5. Ablations
We do extensive ablation studies to analyze the effectiveness of our major contributions.
SRC. We ablate the application strategy for SRC in Tab. 5, finding that applying it directly to predicted depth degrades performance. As discussed in Sec. 3.2, this is because some SAM mask fragmentation introduces noise by forcing discontinuities on the same object. We also analyze it in Tab. 3. SRC plays a critical role in our full model when combined with the other components. It effectively enhances the feature when the predicted depth tends to align with SAM masks, which is not the case when it is solely applied.
AROM & Lrgl. As shown in Tab. 4, our proposed AROM combined with significantly outperforms the conventional edge-aware smoothness loss based on image edges or SAM boundaries, which is consistent with our analysis in

Figure 5. Qualitative comparison of depth predictions under diverse conditions. The first two rows show results on nuScenes [3] (rain and nighttime), and the last two rows show results on Robotcar [20] (daytime and nighttime).
| SRC | AROM | ORE | night – nuScenes | day-rain – nuScenes | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | AbsRel↓ | SqRel↓ | RMSE↓ | δ1 ↑ | ||||
| ✓ | 0.1725 | 1.833 | 7.828 | 73.21 | 0.1270 | 1.623 | 6.710 | 82.82 | |||
| ✓ | 0.1711 | 1.806 | 7.774 | 73.24 | 0.1263 | 1.612 | 6.681 | 83.03 | |||
| ✓ | 0.1734 | 1.841 | 7.819 | 73.14 | 0.1289 | 1.657 | 6.794 | 82.87 | |||
| ✓ | ✓ | 0.1699 | 1.804 | 7.756 | 73.67 | 0.1259 | 1.603 | 6.639 | 83.17 | ||
| ✓ | ✓ | ✓ | 0.1673 | 1.798 | 7.736 | 73.89 | 0.1249 | 1.608 | 6.621 | 83.45 | |
| ✓ | ✓ | ✓ | ✓ | 0.1667 | 1.775 | 7.729 | 73.95 | 0.1236 | 1.521 | 6.613 | 83.53 |
Table 3. Ablations study of our components on nuScenes [3]. The checkmark indicates the inclusion of the corresponding component.
| Smoothness Loss | night – nuScenes | day-rain – nuScenes | ||
|---|---|---|---|---|
| AbsRel↓ | δ1 ↑ | AbsRel↓ | δ1 ↑ | |
| Image-edge-aware | 0.1735 | 73.15 | 0.1280 | 82.75 |
| SAM-boundary-aware | 0.1732 | 73.17 | 0.1273 | 82.78 |
| AROM & (Ours) | 0.1699 | 73.67 | 0.1259 | 83.17 |
Table 4. Ablation study on different smoothness loss definitions, SAM-boundary-aware smoothness loss indicates replacing with in Eq. (3).
| Method | night – nuScenes | day-rain – nuScenes | ||
|---|---|---|---|---|
| AbsRel↓ | δ1 ↑ | AbsRel↓ | δ1 ↑ | |
| SRC on | 0.1694 | 73.68 | 0.1261 | 83.05 |
| SRC (Ours) | 0.1667 | 73.95 | 0.1236 | 83.53 |
Table 5. Ablation study on different implementations of Eq. (2).
Sec. 3.3. We also ablate their individual roles in Tab. 3. Removing AROM prevents the model from suppressing pseudo-label outliers in the depth distillation loss (Eq. (10)), while removing makes the model lack regional supervision needed to enforce smoothness. Consequently, either
component alone leads to inferior performance.
ORE. As shown in Tab. 3, by incorporating object-level reliability through ORE, the depth distillation loss becomes more effective, enabling the model to progressively improve its performance under real-world diverse conditions.
6. Conclusion
This work presents RoSAMDepth, a novel robust self-supervised monocular depth estimation framework that leverages object-level priors from SAM during training. Our method integrates three key components: segment-guided representation contrasting (SRC) for structural awareness, adaptive regional outlier masking (AROM) with regional Gaussian likelihood loss for consistent depth, and object-level reliability estimation (ORE) for reliability-aware learning. Experiments on challenging datasets demonstrate consistent improvements over existing methods across diverse conditions.
References
[1] Shariq Farooq Bhat, Ibraheem Alhashim, and Peter Wonka. Adabins: Depth estimation using adaptive bins. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4009–4018, 2021.
[2] Jia-Wang Bian, Huangying Zhan, Naiyan Wang, Zhichao Li, Le Zhang, Chunhua Shen, Ming-Ming Cheng, and Ian Reid. Unsupervised scale-consistent depth learning from video. International Journal of Computer Vision, 129(9):2548–2564, 2021.
[3] Holger Caesar, Varun Bankiti, Alex H Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 11621–11631, 2020.
[4] Ziyue Feng, Liang Yang, Longlong Jing, Haiyan Wang, YingLi Tian, and Bing Li. Disentangling object motion and occlusion for unsupervised multi-frame monocular depth. In European Conference on Computer Vision, pages 228–244. Springer, 2022.
[5] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2002–2011, 2018.
[6] Stefano Gasperini, Patrick Koch, Vinzenz Dallabetta, Nassir Navab, Benjamin Busam, and Federico Tombari. R4dyn: Exploring radar for self-supervised monocular depth estimation of dynamic scenes. In 2021 International Conference on 3D Vision (3DV), pages 751–760. IEEE, 2021.
[7] Stefano Gasperini, Nils Morbitzer, HyunJun Jung, Nassir Navab, and Federico Tombari. Robust monocular depth estimation under challenging conditions. In Proceedings of the IEEE/CVF international conference on computer vision, pages 8177–8186, 2023.
[8] Clément Godard, Oisin Mac Aodha, Michael Firman, and Gabriel J Brostow. Digging into self-supervised monocular depth estimation. In Proceedings of the IEEE/CVF international conference on computer vision, pages 3828–3838, 2019.
[9] Vitor Guizilini, Rui Hou, Jie Li, Rares Ambrus, and Adrien Gaidon. Semantically-guided representation learning for self-supervised monocular depth. arXiv preprint arXiv:2002.12319, 2020.
[10] Vitor Guizilini, Rares Ambrus, Dian Chen, Sergey Zakharov, and Adrien Gaidon. Multi-frame self-supervised depth with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 160–170, 2022.
[11] Mu He, Le Hui, Yikai Bian, Jian Ren, Jin Xie, and Jian Yang. Ra-depth: Resolution adaptive self-supervised monocular depth estimation. In European Conference on Computer Vision, pages 565–581. Springer, 2022.
[12] Hyunyoung Jung, Eunhyeok Park, and Sungjoo Yoo. Fine-grained semantics-aware representation enhancement for self-supervised monocular depth estimation. In Proceedings
of the IEEE/CVF international conference on computer vision, pages 12642–12652, 2021.
[13] Diederik P Kingma. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
[14] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. In Proceedings of the IEEE/CVF international conference on computer vision, pages 4015–4026, 2023.
[15] Jin Han Lee, Myung-Kyu Han, Dong Wook Ko, and Il Hong Suh. From big to small: Multi-scale local planar guidance for monocular depth estimation. arXiv preprint arXiv:1907.10326, 2019.
[16] Hanhan Li, Ariel Gordon, Hang Zhao, Vincent Casser, and Anelia Angelova. Unsupervised monocular depth learning in dynamic scenes. In Conference on Robot Learning, pages 1908–1917. PMLR, 2021.
[17] Rui Li, Dong Gong, Wei Yin, Hao Chen, Yu Zhu, Kaixuan Wang, Xiaozhi Chen, Jinqiu Sun, and Yanning Zhang. Learning to fuse monocular and multi-view cues for multi-frame depth estimation in dynamic scenes. In Proceedings of the IEEE/CVF Conference on computer vision and pattern recognition, pages 21539–21548, 2023.
[18] Lina Liu, Xibin Song, Mengmeng Wang, Yong Liu, and Liangjun Zhang. Self-supervised monocular depth estimation for all day images using domain separation. In Proceedings of the IEEE/CVF international conference on computer vision, pages 12737–12746, 2021.
[19] Jingyuan Ma, Xiangyu Lei, Nan Liu, Xian Zhao, and Shiliang Pu. Towards comprehensive representation enhancement in semantics-guided self-supervised monocular depth estimation. In European Conference on Computer Vision, pages 304–321. Springer, 2022.
[20] Will Maddern, Geoffrey Pascoe, Chris Linegar, and Paul Newman. 1 year, 1000 km: The oxford robotcar dataset. The International Journal of Robotics Research, 36(1):3–15, 2017.
[21] Yifan Mao, Jian Liu, and Xianming Liu. Stealing stable diffusion prior for robust monocular depth estimation. arXiv preprint arXiv:2403.05056, 2024.
[22] Jaeho Moon, Juan Luis Gonzalez Bello, Byeongjun Kwon, and Munchurl Kim. From-ground-to-objects: Coarse-to-fine self-supervised monocular depth estimation of dynamic objects with ground contact prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10519–10529, 2024.
[23] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
[24] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019.
[25] Yu Qiao, Chaoning Zhang, Taegoo Kang, Donghun Kim, Chenshuang Zhang, and Choong Seon Hong. Robustness of sam: Segment anything under corruptions and beyond. arXiv preprint arXiv:2306.07713, 2023.
[26] René Ranftl, Alexey Bochkovskiy, and Vladlen Koltun. Vision transformers for dense prediction. In Proceedings of the IEEE/CVF international conference on computer vision, pages 12179–12188, 2021.
[27] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10684–10695, 2022.
[28] Kieran Saunders, George Vogiatzis, and Luis J Manso. Self-supervised monocular depth estimation: Let's talk about the weather. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8907–8917, 2023.
[29] Xinru Shan and Chaoning Zhang. Robustness of segment anything model (sam) for autonomous driving in adverse weather conditions. arXiv preprint arXiv:2306.13290, 2023.
[30] Jaime Spencer, Richard Bowden, and Simon Hadfield. Defeat-net: General monocular depth via simultaneous unsupervised representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 14402–14413, 2020.
[31] Fabio Tosi, Pierluigi Zama Ramirez, and Matteo Poggi. Diffusion models for monocular depth estimation: Overcoming challenging conditions. In European Conference on Computer Vision, pages 236–257. Springer, 2024.
[32] Madhu Vankadari, Sourav Garg, Anima Majumder, Swagat Kumar, and Ardhendu Behera. Unsupervised monocular depth estimation for night-time images using adversarial domain feature adaptation. In European Conference on Computer Vision, pages 443–459. Springer, 2020.
[33] Madhu Vankadari, Stuart Golodetz, Sourav Garg, Sangyun Shin, Andrew Markham, and Niki Trigoni. When the sun goes down: Repairing photometric losses for all-day depth estimation. In Conference on Robot Learning, pages 1992–2003. PMLR, 2023.
[34] Jiyuan Wang, Chunyu Lin, Lang Nie, Shujun Huang, Yao Zhao, Xing Pan, and Rui Ai. Weatherdepth: Curriculum contrastive learning for self-supervised depth estimation under adverse weather conditions. In 2024 IEEE International Conference on Robotics and Automation (ICRA), pages 4976–4982. IEEE, 2024.
[35] Kun Wang, Zhenyu Zhang, Zhiqiang Yan, Xiang Li, Baobei Xu, Jun Li, and Jian Yang. Regularizing nighttime weirdness: Efficient self-supervised monocular depth estimation in the dark. In Proceedings of the IEEE/CVF international conference on computer vision, pages 16055–16064, 2021.
[36] Jamie Watson, Oisin Mac Aodha, Victor Prisacariu, Gabriel Brostow, and Michael Firman. The temporal opportunist: Self-supervised multi-frame monocular depth. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 1164–1174, 2021.
[37] Weilong Yan, Ming Li, Haipeng Li, Shuwei Shao, and Robby T Tan. Synthetic-to-real self-supervised robust depth estimation via learning with motion and structure priors. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 21880–21890, 2025.
[38] Zhichao Yin and Jianping Shi. Geonet: Unsupervised learning of dense depth, optical flow and camera pose. In Pro-
ceedings of the IEEE conference on computer vision and pattern recognition, pages 1983–1992, 2018.
[39] Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. In Proceedings of the IEEE/CVF international conference on computer vision, pages 3836–3847, 2023.
[40] Ning Zhang, Francesco Nex, George Vosselman, and Norman Kerle. Lite-mono: A lightweight cnn and transformer architecture for self-supervised monocular depth estimation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 18537–18546, 2023.
[41] Yupeng Zheng, Chengliang Zhong, Pengfei Li, Huan-ang Gao, Yuhang Zheng, Bu Jin, Ling Wang, Hao Zhao, Guyue Zhou, Qichao Zhang, et al. Steps: Joint self-supervised nighttime image enhancement and depth estimation. arXiv preprint arXiv:2302.01334, 2023.
[42] Ziqiang Zheng, Yang Wu, Xinran Han, and Jianbo Shi. Forkgan: Seeing into the rainy night. In European conference on computer vision, pages 155–170. Springer, 2020.
[43] Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised learning of depth and ego-motion from video. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1851–1858, 2017.
[44] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223–2232, 2017.
RoSAMDepth: Robust Self-supervised Depth Estimation Leveraging Segment Anything Model
Supplementary Material
A. Methods Details
A.1. SAM Mask Generation
SAM often produces a hierarchical set of masks for a single object, detecting not only the entire object but also its constituent parts (e.g., wheels, wheels, doors, windows, lights, and even bumpers for a car, as shown in Fig. S1). While detailed, this hierarchy introduces redundancy and potential noise for tasks requiring object-level information. To address this, we adopt a simple yet effective strategy. We assume that in overlapping masks, the mask with the largest spatial extent represents the object instance, while smaller nested masks represent its parts.
Formally, let denote the set of binary masks produced by SAM for an input image , where is the -th mask. Specifically, we iterate through masks with an area below a threshold (set to pixels, approx. ). If a small mask is significantly covered by a larger mask (overlap ratio ), it is considered a sub-part and is merged into the larger parent mask. As shown in Fig. S1, the resulting unified segmentations serve as robust object-level priors. These object-level priors ensure that the network achieves consistent and accurate depth predictions across the entire object instance.
A.2. Training Framework
We build upon the Syn2Real-Depth framework [37] to investigate how object-level priors from SAM [14] can enhance robust self-supervised depth estimation in diverse real-world scenes. Syn2Real-Depth serves as an ideal baseline due to its real adaptation stage designed for diverse real data. The framework employs ManyDepth [36] as the depth backbone, originally defining three domain-specific models: (trained on real daytime data), (trained on diverse synthetic data), and (trained on diverse real data). The pose network follows the standard architecture described in [8, 36]. Since our contribution focuses on integrating SAM-based guidance into the real-world adaptation stage, we simplify the notation to better reflect our training paradigm. Specifically, we designate as the initial teacher , and as the student , which is fine-tuned on real data with object-level priors.
A.3. Implementation Details
Our model is trained on a single NVIDIA 4090D GPU, taking about 10 hours. Regarding the hyperparameters, we set the temperature and the number of feature scales
| Method | night – nuScenes | day-rain – nuScenes | ||
|---|---|---|---|---|
| AbsRel↓ | δ1 ↑ | AbsRel↓ | δ1 ↑ | |
| S=1 | 0.1674 | 73.88 | 0.1250 | 83.45 |
| S=2 | 0.1671 | 73.91 | 0.1244 | 83.47 |
| S=3 | 0.1667 | 73.95 | 0.1236 | 83.53 |
| S=4 | 0.1665 | 73.95 | 0.1234 | 83.55 |
Table S1. Ablation study on the number of feature scales () used in Eq. (2).
for . For the temperature-controlled sharpening sigmoid function , the sharpening temperature is set to . In the object-level reliability estimation (ORE) strategy, we employ a scaling factor and a bias term . Finally, the balancing weights for the total objective are set to and .
A.4. Supervision Details
To ensure robust performance under adverse conditions, our training on real data inherits the auxiliary losses from Syn2Real-Depth [37]. Specifically, we incorporate the external loss term , which comprises the K-L divergence (), the cost volume learning loss (), and the supervision for pose (), following the exact formulation in [37]. We retain these components unchanged to leverage their proven efficacy in the real data. This allows us to isolate the source of performance gains, demonstrating that our proposed object-level integration provides additive improvements over a strong baseline.
B. Additional Results
B.1. Ablation on Number of Feature Scales
We analyze the sensitivity of our method to the number of feature scales used in Eq. (2) and the results are presented in Tab. S1. We ultimately set to balance efficiency and accuracy, as including the highest-resolution feature map introduces significant computational overhead without yielding noticeable performance gains.
B.2. More Qualitative Examples
As supplementary to the main paper, we provide more qualitative results on nuScenes [3] (day-clear, night, day-rain), Robotcar [20] (daytime, nighttime), as shown in Figs. S2 and S3.

Figure S1. Example of the SAM masks generation.

Figure S2. More qualitative results on nuScenes [3]

Figure S3. More qualitative results on Robotcar [20]