Confidence-Guided Fusion for Self-Supervised Monocular Depth Estimation in Endoscopy Authors: Shuang Li, Hongbo Wang, Zhaoxu Hu, Tian Chu, Yingping Li, Liang Zhao Published: 2026 ABSTRACT Accurate monocular depth estimation (MDE) is a foundational task in endoscopic surgery, critical for augmenting depth perception and aiding surgical navigation. While diffusion-based and discriminative depth estimators demonstrate complementary strengths, they also exhibit asymmetric errors: discriminative models yield precise geometric boundaries but struggle in homogeneous or saturated areas, whereas diffusion models recover fine textures at the cost of occasional structural incoherence. To systematically exploit this complementarity, we present CoDepth, a novel framework that leverages confidence-guided fusion to harmonize the outputs of these heterogeneous estimators. Its core components include a complementary map extractor that identifies structured disparity disagreements, a cross-attention module for context-aware feature integration, and a probabilistic confidence network that generates spatially adaptive fusion weights. Extensive evaluations on the SCARED dataset show that CoDepth achieves improved overall performance relative to strong single-model baselines, with the most consistent gains observed in Abs Rel and δ-based accuracy, while changes in some other error metrics are more modest. Furthermore, CoDepth exhibits encouraging cross-domain generalization. When a model trained on SCARED is directly evaluated on SERV-CT, Hamlyn, and C3VD without fine-tuning, it achieves competitive performance and improves several key metrics across datasets. The framework also demonstrates enhanced robustness against common synthetic corruptions like low-light conditions, Gaussian noise, and impulse noise, underscoring its practical utility in complex clinical settings. These results suggest that confidence-guided complementary fusion provides a practical integration-level paradigm for combining heterogeneous endoscopic depth estimators. 1. Introduction Deep learning has been extensively applied in various image processing domains, including image classification, object detection, image segmentation, image generation, and image captioning [1]. In particular, in medical image processing, it enables automated analysis of X-ray images, CT scans, and magnetic resonance data to assist physicians in the detection of abnormalities and disease diagnosis, among other applications. Monocular depth estimation is a fundamental task in medical image processing, aimed at predicting the depth of each pixel from a single RGB image. With rapid advances in deep learning, this technology has found applications in various fields, including augmented reality [2], scene understanding [3], and minimally invasive surgery [4]. In medical image processing, particularly in endoscopic surgery, monocular depth estimation is vital to helping surgeons understand the relative distances between objects within the endoscopic field of view. This capability aids in precise location identification and navigation within the human body. Accurate depth information enables physicians to assess spatial relationships between organ tissues and surgical instruments, reducing accidental injuries and improving surgical outcomes. However, depth estimation in endoscopic settings presents challenges that distinguish it from traditional depth estimation tasks. A primary issue is the scarcity of real-world depth data, as acquiring ground truth is often impractical due to the invasive nature of surgeries. This constraint necessitates the adoption of self-supervised or unsupervised learning techniques. Additionally, the dynamic nature of soft tissues, with frequent deformations and movements, violates the assumptions of the static scene typically used in traditional methods. The endoscopic environment is further complicated by unstable lighting, specular highlights, and limited texture, all of which diminish the reliability of photometric cues. Moreover, the narrow field of view of endoscopic cameras, combined with frequent motion blur, limits the spatial context and presents challenges for accurate depth estimation. To overcome these challenges, researchers have proposed innovative solutions leveraging deep learning and computer vision advancements. Both discriminative and generative paradigms have proven effective in depth estimation tasks. The discriminative paradigm focuses on learning a direct mapping between inputs and outputs, where models predict depth information from input images. In endoscopy, refs. [4,5,6,7] have achieved promising results with this paradigm. The generative paradigm, on the other hand, models the data generation process, learning the joint distribution of inputs and outputs to generate plausible depth maps. In endoscopy, refs. [8,9,10] have also achieved significant results using generative models. Upon reviewing previous research, we observed asymmetric error patterns between the discriminative and generative paradigms. The discriminative paradigm excels at making fast and accurate global predictions, particularly when ample labeled data is available. However, it struggles in complex or sparse data scenarios, especially when the scene contains intricate local details. Conversely, the generative paradigm excels at handling incomplete data or complex scenes, capturing local details more effectively and performing better in noisy or ambiguous environments, though it requires more computational resources for training and inference. These observations led us to hypothesize that combining the strengths of both paradigms could reduce asymmetric errors and enhance accuracy. To illustrate this, Figure 1 presents several failure cases of state-of-the-art monocular depth estimation methods on the SCARED dataset. As shown, the AF-SfMLearner method [4], based on the CNN-based discriminative paradigm, and the MonoDiffusion approach [8], based on the generative diffusion model paradigm, fail in different regions of the same input image. For instance, in the third column, MonoDiffusion accurately predicts the tissue boundaries within the white box, while the results from AF-SfMLearner appear blurry. On the other hand, AF-SfMLearner captures tissue boundaries within the green box, whereas MonoDiffusion fails to resolve them clearly. To mitigate these failure cases, we introduce a depth estimator that intuitively combines the strengths of both paradigms to achieve comprehensive and accurate depth estimation. This paper introduces CoDepth, a confidence-guided complementary fusion framework for self-supervised monocular depth estimation in endoscopy. Unlike traditional single-model estimators, CoDepth explicitly models the structured disagreement between heterogeneous depth predictors and leverages this complementary information to achieve robust depth estimation under challenging surgical conditions. Our approach integrates discriminative and generative depth estimators through a suite of newly designed modules—a complementary map extractor, a 2D cross-attention fusion mechanism, a probabilistic confidence network, and a multi-scale fusion strategy. In the present implementation, the discriminative model, the diffusion model, and the auxiliary geometric modules remain frozen, while the fusion-related modules are trained in a self-supervised manner. The core innovation of CoDepth lies in its ability to capture, interpret, and exploit model disagreement. The complementary map extractor first encodes structured disparity inconsistencies between two base predictors, revealing where each model succeeds or fails. A 2D multi-head cross-attention module then performs context-aware feature integration, aligning fine structural cues from the generative model with the globally consistent representations of the discriminative model. The fused features are further aggregated across multiple scales to enhance geometric reasoning at varying resolutions. Finally, a probabilistic confidence network predicts spatially adaptive fusion weights, guided by a multi-term confidence loss (overlap, entropy, and balance) that avoids ambiguous assignments and prevents collapse or bias, leading to stable and meaningful confidence estimation. Through this confidence-guided complementary fusion pipeline, CoDepth effectively resolves the asymmetric error distributions that arise when deploying heterogeneous models in complex, deformable, and texture-sparse endoscopic environments. The framework adapts fusion weights at each pixel based on the estimated reliability of each predictor, enabling consistent improvements across diverse anatomical structures and imaging conditions. The main contributions of this work are summarized as follows:We present CoDepth, a novel confidence-guided complementary fusion framework designed to address the asymmetric depth estimation errors commonly observed in endoscopic monocular depth estimation. CoDepth introduces a new perspective on multi-model depth estimation by explicitly modeling estimator disagreement and leveraging it through complementary feature extraction and attention-based integration.We design a multi-stage fusion architecture integrating Complementary Map Extraction, CrossAttention2D, Multi-scale Fusion, and Probabilistic Confidence Estimation. The Complementary Map Extractor distills structured disparity disagreements between heterogeneous depth predictors. The CrossAttention2D module performs context-aware fusion of complementary and semantic features, aligning local structural details with global depth consistency. Multi-scale fusion enhances geometric reasoning across resolutions, supporting robust predictions in complex surgical scenes. A Probabilistic Confidence Network adaptively weights each base estimator at the pixel level, trained with a multi-term confidence loss (overlap, entropy, and balance) that avoids ambiguous assignments, prevents confidence collapse or bias, and yields stable, semantically meaningful confidence maps.We conduct comprehensive experiments on four challenging datasets, SCARED, SERV-CT, Hamlyn, and C3VD, to validate the effectiveness of CoDepth. The results show that CoDepth achieves competitive overall performance across these benchmarks and improves several key depth metrics, with the clearest gains observed in Abs Rel and δ<1.25. We present CoDepth, a novel confidence-guided complementary fusion framework designed to address the asymmetric depth estimation errors commonly observed in endoscopic monocular depth estimation. CoDepth introduces a new perspective on multi-model depth estimation by explicitly modeling estimator disagreement and leveraging it through complementary feature extraction and attention-based integration. We present CoDepth, a novel confidence-guided complementary fusion framework designed to address the asymmetric depth estimation errors commonly observed in endoscopic monocular depth estimation. CoDepth introduces a new perspective on multi-model depth estimation by explicitly modeling estimator disagreement and leveraging it through complementary feature extraction and attention-based integration. We design a multi-stage fusion architecture integrating Complementary Map Extraction, CrossAttention2D, Multi-scale Fusion, and Probabilistic Confidence Estimation. The Complementary Map Extractor distills structured disparity disagreements between heterogeneous depth predictors. The CrossAttention2D module performs context-aware fusion of complementary and semantic features, aligning local structural details with global depth consistency. Multi-scale fusion enhances geometric reasoning across resolutions, supporting robust predictions in complex surgical scenes. A Probabilistic Confidence Network adaptively weights each base estimator at the pixel level, trained with a multi-term confidence loss (overlap, entropy, and balance) that avoids ambiguous assignments, prevents confidence collapse or bias, and yields stable, semantically meaningful confidence maps. We design a multi-stage fusion architecture integrating Complementary Map Extraction, CrossAttention2D, Multi-scale Fusion, and Probabilistic Confidence Estimation. The Complementary Map Extractor distills structured disparity disagreements between heterogeneous depth predictors. The CrossAttention2D module performs context-aware fusion of complementary and semantic features, aligning local structural details with global depth consistency. Multi-scale fusion enhances geometric reasoning across resolutions, supporting robust predictions in complex surgical scenes. A Probabilistic Confidence Network adaptively weights each base estimator at the pixel level, trained with a multi-term confidence loss (overlap, entropy, and balance) that avoids ambiguous assignments, prevents confidence collapse or bias, and yields stable, semantically meaningful confidence maps. We conduct comprehensive experiments on four challenging datasets, SCARED, SERV-CT, Hamlyn, and C3VD, to validate the effectiveness of CoDepth. The results show that CoDepth achieves competitive overall performance across these benchmarks and improves several key depth metrics, with the clearest gains observed in Abs Rel and δ<1.25. We conduct comprehensive experiments on four challenging datasets, SCARED, SERV-CT, Hamlyn, and C3VD, to validate the effectiveness of CoDepth. The results show that CoDepth achieves competitive overall performance across these benchmarks and improves several key depth metrics, with the clearest gains observed in Abs Rel and δ<1.25. 2. Related Work 2.1. Self-Supervised Depth Estimation Monocular depth estimation (MDE) aims to infer depth from a single image. Existing methods are generally categorized into supervised and self-supervised depth estimation. Supervised methods require ground-truth depth data for model training, which can be costly due to the difficulty in obtaining real depth maps. In contrast, Self-supervised methods do not require labeled data. Instead, they generate labels during training based on the structure and characteristics of the data itself, using geometric relationships, and training the model similarly to supervised learning. Garg et al. [11] first proposed a basic framework for training models via unsupervised learning. This framework included a convolutional neural network (CNN) for depth estimation and an image reconstruction module. Godard et al. [12] further refined this method by introducing a differentiable interpolation function, optimizing the loss function, and proposing surface-matching loss and disparity-smoothness loss, which have since become widely used in unsupervised depth estimation. While image-pair-based methods have shown promising results, they also have notable drawbacks. For instance, they require the baseline length and camera focal length to be determined, along with images from both left and right viewpoints. These constraints limit the range of datasets available for training. To address this, researchers have proposed unsupervised methods that utilize video sequences. These methods leverage the geometric relationships between consecutive frames for training. Zhou et al. [13] pioneered a dual-network architecture, consisting of depth and pose estimation networks, which synthesize novel views via warping transformations and implement occlusion-aware masking mechanisms. To mitigate the impact of pixel points that violate the static assumption, methods based on explainable masks [14,15] have been proposed. Johnston and Carnerio [16] enhanced self-supervised monocular depth estimation by incorporating self-attention and discrete disparity prediction, which enables better context exploration and more robust depth estimation. Liu et al. [17] introduced a self-supervised method using distillation and disparity-offset refinement to improve depth performance. Liu and Zuo [18] added a dual-attention mechanism with position and channel attention modules to capture long-range contextual information. Further advancements include Zhang et al.’s [19] Lite-Mono, a hybrid CNN-Transformer architecture, and Yang et al.’s [20] integration of Transformer layers into CNNs to enhance texture sensitivity and use multi-head attention for pose estimation. Xu et al. [21] developed a self-supervised framework for depth and pose estimation that incorporates a Generative Latent Bank and Variational Autoencoders (VAEs). Zhu and Cui [22] introduced cosine-dissimilarity-based perceptual loss to strengthen the supervisory signals. 2.2. Diffusion Models Diffusion models, as one of the leading generative models, have significantly advanced artificial intelligence by enabling the generation of high-quality data across various domains, including image synthesis, video generation, 3D creation, medical analysis, text generation, speech synthesis, time-series generation, molecular design, and graph generation. Diffusion models consist of two key processes: a forward process and a reverse process. In the forward process, noise is gradually added to the data, transforming it into a simpler distribution, typically Gaussian. The reverse process uses a trained neural network to iteratively remove this noise, recovering the original data. The network is trained using denoising score matching to predict and eliminate noise, enabling diffusion models to generate high-quality data by reversing the noise transformation. The diffusion model has made notable advancements in the application of Monocular Depth Estimation (MDE). Saxena et al. [23] introduce DepthGen, a diffusion model for monocular depth estimation, which comprises self-supervised pre-training and supervised fine-tuning. Duan et al. [24] emphasize a denoising strategy to iteratively refine depth maps, using diffusion models to mitigate noisy depth predictions and enhance accuracy in complex environments. Their work primarily focuses on a fully supervised setting. In self-supervised MDE, Shao et al. [8] propose the MonoDiffusion framework, treating depth estimation as an iterative denoising process. This method eliminates the need for real depth labels by using pseudo-labels and teacher models for self-supervised training. Furthermore, the integration of transformers with diffusion models has shown significant promise in scaling depth estimation models. Peebles and Xie [25] introduced diffusion transformers, a scalable architecture that enhances depth-estimation accuracy by leveraging transformers to generate high-resolution depth maps. 3. Materials and Methods 3.1. Method Overview and Problem Formulation Monocular depth estimation in endoscopy remains challenging due to weak texture, specular highlights, non-rigid tissue deformation, and frequent local ambiguities. In practice, different depth estimation paradigms often exhibit complementary behaviors: discriminative estimators usually provide more stable global geometric structure, whereas diffusion-based estimators may recover finer local details but can also introduce structural inconsistency in difficult regions. Rather than proposing a new backbone depth estimator, this work addresses a different problem: how to reliably integrate two frozen heterogeneous depth estimators with complementary error patterns. Given an input endoscopic image I, the inherited discriminative and diffusion-based estimators produce two depth predictions,(1)Ddisc=Mdisc(I),Ddiff=Mdiff(I).Our goal is to learn a fusion function(2)Dfuse=F(I,Ddisc,Ddiff), that preserves the global structural stability of the discriminative branch while selectively incorporating locally informative details from the diffusion branch. To this end, we propose a complementarity-aware confidence-guided fusion method that explicitly models inter-estimator disagreement and converts it into spatially adaptive fusion confidence. An overview of the framework is shown in Figure 2 and Figure 3. As illustrated in Figure 2, given a target frame It∈RH×W×3, the two models infer depth in parallel. Their pixel-wise prediction discrepancy is exploited to characterize model complementarity and local uncertainty. To estimate the reliability of the two predictions, intermediate features from both models are aggregated by a cross-attention fusion module, enabling effective interaction between discriminative and diffusion-based representations. In parallel, discrepancy cues extracted from prediction differences highlight regions with inconsistent confidence or distinct structural preferences. These cues are combined with the fused features and passed to a confidence estimation module. The confidence estimation module predicts a dense confidence map C∈[0,1]H×W, which encodes the pixel-wise reliability of the two models. Based on C, a confidence-aware fusion strategy adaptively combines the two depth predictions to produce the final estimate D^t, thereby improving local detail preservation and global structural consistency. For self-supervised training, an adjacent frame is used as the source frame to provide multi-view geometric constraints. The relative pose between the source and target frames is estimated by the motion module. Given the camera intrinsic matrix K, the source frame is warped into the target view via a spatial transformer to generate a synthesized frame, whose appearance discrepancy from the target frame serves as a photometric supervision signal. Meanwhile, the position module estimates a registration frame from the source and target frames, and the appearance module further refines it through brightness calibration to obtain a photometrically corrected frame. These reconstructed frames, together with photometric reconstruction and geometric consistency losses, are used to optimize the depth estimation networks. The fusion-related modules are further supervised by geometric consistency and confidence regularization terms. To avoid ambiguity between the internal branch names used in CoDepth and the external baselines reported in the experiments Table 1 summarizes the role of each branch, its relation to the corresponding baseline method, whether its weights are updated during training, and which outputs are used by the proposed fusion module. 3.2. Frozen Base Estimators and Inherited Supervision To clearly separate inherited components from methodological novelty, we emphasize that the discriminative estimator, the diffusion estimator, and the auxiliary geometric supervision modules are all adopted from prior work and remain frozen in this study. 3.2.1. Frozen Discriminative Model This model adopts an encoder–decoder architecture with skip connections, where the encoder is based on ResNet-18 [26] with the fully connected layer removed. The decoder design follows that of Monodepth2 [14]. This model provides complementary structural information. All weights in this model are frozen during training, serving as a stable supervisory signal. 3.2.2. Frozen Diffusion Model The model primarily consists of two modules: a teacher module and a student module. The teacher module guides the denoising process of the student module through visual guidance conditions and knowledge distillation, leveraging its depth maps and multi-view filters. The teacher module adopts the AF-sfMLeaner [4] architecture, which achieves full-resolution depth prediction via a multi-scale approach and enhances training stability through gradient locality in the Spatial Transformer network. The student module utilizes a Lite-Mono encoder [19] to extract multi-scale features from the input images. These features are then processed through multiple 3 × 3 convolutional layers and upsampling layers to generate visual guidance conditions that steer the diffusion-based denoising process. The decoder of the student module follows the design of HRDepthDecoder [19]. 3.2.3. Inherited Geometric Supervision Modules We also retain the auxiliary motion, position, and appearance modules inherited from the original self-supervised reconstruction pipeline [4]. These modules are used only to provide training-time geometric or photometric supervision. Motion Module The motion module estimates the relative camera pose between consecutive frames for geometry-based view synthesis. Let T12=[R,t] denote the transformation from the reference frame I1 to the target frame I2, where R and t are the rotation matrix and translation vector, respectively. Following [4], we adopt an encoder–decoder network to predict the 6-DoF pose from the input frame pair. Based on the estimated pose, the reference view is warped to synthesize the target view:(3)p2=Rp1+t.Here, p1 and p2 denote corresponding pixel coordinates in I1 and I2. To handle non-grid-aligned coordinates after transformation, bilinear interpolation is applied:(4)I2(p2)=∑kK(p2−p1,k)I1(p1,k), where K(·) is the interpolation kernel and k indexes neighboring pixels. Position Module The position module performs dense registration between the source image Is and the target image It. It consists of an encoder–decoder architecture, where the encoder extracts multiscale geometric features from the input pair and the decoder predicts an optical flow field F together with an occlusion mask Mocc. The flow field F∈RH×W×2 encodes the pixel-wise displacement from Is to It, while the occlusion mask Mocc∈{0,1}H×W is estimated via bidirectional flow consistency:(5)Mocc=IFforward−Fbackward−11>τ, where Fforward and Fbackward denote the forward and backward flows, respectively, and τ is a threshold. The source image is warped to the target view as(6)Is→t=W(Is,F), where W denotes differentiable warping with bilinear sampling. The final registered image is obtained by occlusion-aware fusion:(7)Ireg=Mocc⊙Is→t+(1−Mocc)⊙It, where ⊙ denotes element-wise multiplication. Appearance Module The appearance module models residual photometric misalignment via an appearance flow Af. Following [4], Af is defined as(8)Af(p)=p2−p1, where p1 and p2 denote the corresponding pixel coordinates in I1 and I2, respectively. The final refined image is obtained by flow-guided resampling of the registered image:(9)Irefined(p)=Ireg(p+Af(p)), where Af compensates for residual appearance discrepancies between the two frames. 3.3. Proposed Confidence-Guided Fusion Method The proposed method is based on the assumption that disagreement between heterogeneous estimators is not purely noise, but a structured cue reflecting local reliability differences. Accordingly, we design a trainable fusion method consisting of Complementary Map Extraction, Cross-Attention Context Fusion, and Probabilistic Confidence Prediction. Given an input target frame It, the two models produce disparity predictions ddisc=M1(It) and ddiff=M2(It) at multiple scales. Their pixel-wise discrepancies are first exploited to obtain a complementary map. Concretely, the absolute difference between the two predictions is normalized to the range [0, 1] to derive preliminary complementary weights that highlight regions where one model is more reliable than the other. These complementary weights are then passed through a lightweight convolutional complementary extractor and a cross-attention module, which interacts with high-level fused features from both models to learn richer complementary representations. On top of these representations, a confidence prediction module outputs a two-channel confidence mapC=[C1,C2]∈[0,1]2×H×W, where C1 and C2 denote the per-pixel confidence for the Discriminative Model and the Diffusion Model, respectively, and satisfy C1+C2=1. The final fused depth d^t is then computed as a confidence-weighted combination of the two predictions:(10)D^t=C1⊙Ddisc+C2⊙Ddiff, where Ddisc represents the depth converted from the disparity ddisc estimated by the discriminative model, and Ddiff represents the depth converted from the disparity ddiff estimated by the diffusion model. ⊙ denotes element-wise multiplication. The confidence maps provide a transparent view of the fusion behavior: regions where C1 dominates are mainly influenced by the discriminative prediction, while regions where C2 is higher rely more on the diffusion-based prediction. Moreover, a dedicated confidence regularization loss encourages non-trivial, well-balanced confidence distributions by penalizing excessive overlap between the two channels, promoting sufficient entropy, and enforcing a global balance between C1 and C2. This design prevents degenerate solutions where one model overwhelms the other and stabilizes the multi-model fusion during self-supervised training. 3.3.1. Complementary Map Extraction To explicitly characterize the asymmetric errors between the two predictors, we compute a normalized complementary map:(11)Δ=|ddisc−ddiff|max(|ddisc−ddiff|)+ϵ, which highlights regions where the two models diverge. A lightweight convolutional extractor ϕcmp transforms the complementary signal into a structured feature representation:(12)Fc=ϕcmp([Δ,1−Δ]). 3.3.2. Cross-Attention Context Fusion To align the complementary features with semantically rich depth representations, we fuse Fc with the multi-scale backbone features {F1(k),F2(k)} through a 2D multi-head cross-attention module [27]:(13)Fa=CrossAttn(Q=WqFc,K=WkFf,V=WvFf), where Ff=F1(k),F2(k) denotes the concatenated features from both models. This operation enables the model to interpret disparity disagreement in a broader geometric and textural context, improving the reliability of confidence estimation. To keep the additional attention cost manageable, CrossAttention2D operates on 2× downsampled feature maps and its output is then upsampled back to the original resolution. This reduces the effective sequence length by approximately 75% while preserving the structural cues required for reliable confidence estimation. 3.3.3. Probabilistic Confidence Prediction The confidence network takes the context-enhanced complementary features Fa as input and predicts pixel-wise confidence logits z=[z1,z2], which are normalized through a softmax function:(14)pi=exp(zi)exp(z1)+exp(z2),i∈1,2.The resulting probability maps p1, p2 form the final confidence maps used for adaptive fusion. The predicted probabilities represent the model’s belief about the reliability of each depth estimator at every pixel. This formulation not only stabilizes the fusion process but also enhances interpretability: regions where diffusion-based estimators excel (e.g., low-texture surfaces) present higher p2, while edge-rich or high-frequency regions favor p1. The confidence maps thus encode a spatially adaptive model selection strategy learned through self-supervised optimization of the fusion branch, while the base estimators remain frozen. 3.3.4. Fusion Objective and Confidence Regularization The proposed fusion branch is designed not to simply average the predictions of two heterogeneous depth estimators, but to learn a spatially adaptive routing mechanism that selects the more reliable branch at each pixel while preserving their complementarity. In endoscopic scenes, discriminative models and diffusion-based models often fail in different regions. Therefore, an effective fusion strategy should satisfy three properties: (i) local exclusivity, to avoid unreliable averaging of conflicting predictions; (ii) decision sharpness, to produce decisive rather than ambiguous confidence assignments; and (iii) global balance, to prevent persistent dominance of one branch. Formally, the fused depth is defined as defined in Equation (10). In the self-supervised setting, no explicit ground-truth labels are available for the confidence maps. We therefore regularize them using three complementary terms: overlap, entropy, and balance. Overlap Regularization To discourage ambiguous fusion, we penalize simultaneous high confidence from both branches at the same pixel:(15)Lov=1HW∑pC1(p)C2(p).This term promotes locally exclusive selection between the two predictors. Entropy Regularization To encourage decisive routing, we minimize the entropy of the confidence distribution:(16)Lent=−1HW∑p∑i=12Ci(p)logCi(p).Minimizing this term yields sharper confidence assignments. In practice, it is activated with a warm-up schedule for training stability. Balance Regularization To avoid global collapse to a single branch, we constrain the spatial mean confidence to remain close to a uniform distribution:(17)C¯i=1HW∑pCi(p),Lbal=∑i=12C¯i−122.This term acts as a weak global prior, encouraging both branches to be utilized without enforcing equal confidence at every pixel. Together, these regularization terms enforce locally exclusive, sharp, and globally balanced confidence prediction, thereby stabilizing adaptive fusion under self-supervised training. 3.4. Training Objective and Optimization Strategy Only the parameters of the proposed fusion method are optimized during training. LetΘbase={Θdisc,Θdiff,Θgeo} denote the parameters of the inherited discriminative estimator, diffusion estimator, and geometric supervision modules, and letΘfuse={ΘCME,ΘCCF,ΘPCP} denote the parameters of the proposed Complementary Map Extraction, Cross-Attention Context Fusion, and Probabilistic Confidence Prediction. During training,∂L∂Θbase=0,∂L∂Θfuse≠0. The overall loss function is composed of multiple terms that enforce photometric consistency, geometric constraints, and smoothness regularization across different scales. The total loss is a weighted sum of individual loss terms, averaged across multiple scales. The complete loss function is as follows:(18)Ltotal=λ1·LD−S+λ2·LR−L+λ3·LT−C+λ4·LT−S+λ5·Lconf where LD−S is the Disparity Smoothness Loss, LR−L is the Reprojection Loss, LT−C is the Transform Constraint Loss, LT−S is the Transform Smoothness Loss, Lconf is the Confidence Loss. Disparity Smoothness Loss: The disparity smoothness loss encourages smooth disparity maps by penalizing large disparity changes between neighboring pixels. This helps to maintain continuity in the depth map and reduce noise. The loss function aims to minimize disparity jumps, promoting a smoother depth estimation.(19)LD−S(s)=λdisp·12s∑p∇d(s)·e−∇ref(s) where d(s) is the predicted disparity map, and λdisp controls the strength of the smoothness term. Disparity Smoothness Loss: The disparity smoothness loss encourages smooth disparity maps by penalizing large disparity changes between neighboring pixels. This helps to maintain continuity in the depth map and reduce noise. The loss function aims to minimize disparity jumps, promoting a smoother depth estimation.(19)LD−S(s)=λdisp·12s∑p∇d(s)·e−∇ref(s) where d(s) is the predicted disparity map, and λdisp controls the strength of the smoothness term. Reprojection Loss: The reprojection loss is crucial for tasks like depth estimation, stereo matching, or 3D reconstruction. It ensures that transformed or refined pixels in the image correspond closely to their target positions in the reference image, ensuring pixel-level accuracy.(20)LR−L=∑s∈Sλsα·SSIM(It,Its)+(1−α)·It−Its1Here, SSIM (Structural Similarity Index) measures the similarity between the predicted and target images, with α balancing the two terms. Reprojection Loss: The reprojection loss is crucial for tasks like depth estimation, stereo matching, or 3D reconstruction. It ensures that transformed or refined pixels in the image correspond closely to their target positions in the reference image, ensuring pixel-level accuracy.(20)LR−L=∑s∈Sλsα·SSIM(It,Its)+(1−α)·It−Its1Here, SSIM (Structural Similarity Index) measures the similarity between the predicted and target images, with α balancing the two terms. Transform Constraint Loss: The transform constraint loss ensures that the refined image closely matches the registered image after transformation. This regularizes the transformation process to ensure consistency across the predicted outputs.(21)LT−C=∑s∈Sγs·Irefineds−Iregs1γs is a scaling factor that controls the weight of this loss term. Transform Constraint Loss: The transform constraint loss ensures that the refined image closely matches the registered image after transformation. This regularizes the transformation process to ensure consistency across the predicted outputs.(21)LT−C=∑s∈Sγs·Irefineds−Iregs1γs is a scaling factor that controls the weight of this loss term. Transform Smoothness Loss: The transform smoothness loss penalizes abrupt changes in brightness after transformation. It ensures that the brightness variation is smooth, avoiding unnatural or sharp transitions in the transformed images.(22)LT−S(s)=λsmooth2∑f∈FLbright(T(s,f),Iref(s),Ireg(s,f),Mocc(f)) where λsmooth is a weight that controls the strength of the smoothness regularization, and Lbright penalizes sudden changes in brightness during the transformation. Transform Smoothness Loss: The transform smoothness loss penalizes abrupt changes in brightness after transformation. It ensures that the brightness variation is smooth, avoiding unnatural or sharp transitions in the transformed images.(22)LT−S(s)=λsmooth2∑f∈FLbright(T(s,f),Iref(s),Ireg(s,f),Mocc(f)) where λsmooth is a weight that controls the strength of the smoothness regularization, and Lbright penalizes sudden changes in brightness during the transformation. Confidence Loss: Based on the above regularization design, the overall confidence loss is defined as(23)Lconf=λovLov+λentLent+λbalLbal, where λov, λent, and λbal are weighting coefficients for the overlap, entropy, and balance terms, respectively. Confidence Loss: Based on the above regularization design, the overall confidence loss is defined as(23)Lconf=λovLov+λentLent+λbalLbal, where λov, λent, and λbal are weighting coefficients for the overlap, entropy, and balance terms, respectively. 3.5. Summary of Methodological Novelty In summary, the novelty of this work lies in the proposed complementarity-aware confidence-guided fusion method, including: (i) explicit modeling of structured disagreement between two frozen heterogeneous depth estimators, (ii) context-aware interaction between complementary cues and estimator features, and (iii) probabilistic confidence-based adaptive depth integration. In contrast, the backbone estimators and auxiliary geometric supervision modules are inherited from prior work and used as frozen components. 4. Results and Discussion 4.1. Experimental Setup 4.1.1. Datasets We conduct extensive experiments on four publicly available surgical datasets. SCARED [28]. The SCARED dataset comprises 35 endoscopic videos captured using a Da Vinci Xi endoscope, showcasing fresh porcine cadaver abdominal anatomy. It includes point cloud data and ego-motion ground truth. SCARED [28]. The SCARED dataset comprises 35 endoscopic videos captured using a Da Vinci Xi endoscope, showcasing fresh porcine cadaver abdominal anatomy. It includes point cloud data and ego-motion ground truth. SERV-CT [29]. The SERV-CT dataset contains 16 pairs of stereo images from two sets of porcine samples. Each sample group provides complete camera intrinsic and extrinsic calibration parameters, depth maps, disparity maps, and occlusion region annotations. The dataset addresses the challenge of validating 3D reconstruction algorithms in surgical endoscopic scenes, especially in scenarios with issues such as the absence of distinct corner features, highly reflective surfaces, and the presence of blood and smoke. SERV-CT [29]. The SERV-CT dataset contains 16 pairs of stereo images from two sets of porcine samples. Each sample group provides complete camera intrinsic and extrinsic calibration parameters, depth maps, disparity maps, and occlusion region annotations. The dataset addresses the challenge of validating 3D reconstruction algorithms in surgical endoscopic scenes, especially in scenarios with issues such as the absence of distinct corner features, highly reflective surfaces, and the presence of blood and smoke. Hamlyn (https://davidrecasens.github.io/EndoDepthAndMotion/ (accessed on 8 October 2025)).The Hamlyn Centre laparoscopic/endoscopic video dataset contains a rich collection of laparoscopic and endoscopic video data. These datasets record various complex surgical scenarios, including pig diaphragm anatomy, lobectomy, TECAB surgery, and more, covering visual challenges such as tissue deformation, motion caused by respiration and heartbeat, smoke blur, and interactions between tools and tissue. The dataset includes 38 videos and sub-datasets, providing researchers with high-quality real surgical video resources. Hamlyn (https://davidrecasens.github.io/EndoDepthAndMotion/ (accessed on 8 October 2025)). The Hamlyn Centre laparoscopic/endoscopic video dataset contains a rich collection of laparoscopic and endoscopic video data. These datasets record various complex surgical scenarios, including pig diaphragm anatomy, lobectomy, TECAB surgery, and more, covering visual challenges such as tissue deformation, motion caused by respiration and heartbeat, smoke blur, and interactions between tools and tissue. The dataset includes 38 videos and sub-datasets, providing researchers with high-quality real surgical video resources. C3VD (https://durrlab.github.io/C3VD/ (accessed on 8 October 2025)).The Colonoscopy 3D Video Dataset (C3VD) is collected using high-definition clinical colonoscopy and high-fidelity colon models, aimed at providing benchmark resources for computer vision methods in colonoscopy scenarios. The dataset includes 22 short videos and 10,015 frames, with each frame accompanied by paired ground truth depth, surface normals, optical flow, occlusion information, six-degree-of-freedom pose, coverage maps, and 3D models. C3VD (https://durrlab.github.io/C3VD/ (accessed on 8 October 2025)). The Colonoscopy 3D Video Dataset (C3VD) is collected using high-definition clinical colonoscopy and high-fidelity colon models, aimed at providing benchmark resources for computer vision methods in colonoscopy scenarios. The dataset includes 22 short videos and 10,015 frames, with each frame accompanied by paired ground truth depth, surface normals, optical flow, occlusion information, six-degree-of-freedom pose, coverage maps, and 3D models. For depth estimation, we perform extensive experiments on the SCARED dataset and then apply models trained on SCARED to the SERV-CT, Hamlyn, and C3VD datasets to validate the generalization ability. Following a split protocol inspired by the Eigen–Zhou evaluation protocol from the KITTI benchmark [30], the SCARED dataset is divided into 15,351 frames for training, 1705 frames for validation, and 551 frames for testing. 4.1.2. Implementation Details CoDepth is implemented using the PyTorch library (version 2.0.1.) and trained on an NVIDIA RTX A5000 (manufactured by NVIDIA Corporation, Santa Clara, CA, USA). The system runs on Ubuntu 18.04 with CUDA 11.8. Our optimization setup employs the Adam optimizer with a base learning rate of 1×10−3, default momentum parameters (β1=0.9,β2=0.999), and no weight decay. We use a StepLR scheduler that decays the learning rate by a factor of 0.1 every 30 epochs. In our experiments, training is conducted for 25 epochs without early stopping, and model checkpoints are saved at regular intervals. All backbone networks are initialized with pretrained weights. The discriminative model, the diffusion model, as well as the pose, position, and transform networks are kept frozen during training and operate in evaluation mode. Only the fusion-related modules are updated: (i) the complementary feature extractor that processes the normalized disparity disagreement between the two depth predictions, (ii) the cross-attention module that injects complementary cues into the fused high-level features, and (iii) the confidence prediction module that outputs the per-pixel confidence maps used for fusion. This design yields an efficient training process that leverages the strengths of multiple pretrained depth and geometric models while learning a lightweight, confidence-guided fusion mechanism. Input images are resized so that both height and width are multiples of 32 to ensure compatibility with the encoder–decoder architectures. During training and validation, we log depth maps, confidence maps, and scalar statistics using TensorBoard, together with periodic validation on the target dataset. Through confidence-guided multi-model fusion and stable geometric supervision, CoDepth achieves accurate and robust monocular depth estimation suitable for complex real-world scenarios. 4.1.3. Evaluation Metrics The evaluation uses several metrics consistent with previous depth estimation works, as follows: Abs Rel: 1|D|∑d∈D|dt−d|dtSq Rel: 1|D|∑d∈Ddt−d2dtRMSE: 1|D|∑d∈Ddt−d2RMSE log: 1|D|∑d∈Dlogdt−logd2δ