## 3 Methodology
### Image Reconstruction
Given the predicted depth maps for static regions \(D_{static}\) and dynamic regions \(D_{dyn}\), the goal is to align the scales by applying a scale factor \(\beta_{o}\) to the depth map of each moving object \(o\):  
\[L_{scale}=\sum_{o}\left|\beta_{o}D_{dyn}(o)-D_{static}\right| \tag{14}\]  
where \(\beta_{o}\) is the scale factor for object \(o\), learned during training. This loss encourages consistency between the depth scales of dynamic and static regions, resolving the scale ambiguity problem that often arises in dynamic scenes. In addition to the main depth prediction at the original resolution of the input image, the DI-MDE framework predicts depth maps at multiple scales. Multi-scale depth prediction is a common strategy in self-supervised learning, as it allows the network to capture depth information at different levels of detail and improves the overall robustness of the predictions. At each scale, the network outputs a depth map \(D_{r}^{s}\) where s denotes the scale level. The photometric consistency loss and smoothness loss are applied at each scale to ensure that depth predictions are consistent across different resolutions. The total loss at all scales is computed as a weighted sum of the losses at each scale:  
\[L_{multi-scale}{=}\sum_{s}\lambda_{s}\Big{(}L_{photo}^{s}+L_{smooth}^{s}\Big{)} \tag{15}\]  
where the smoothness loss term \(L_{smooth}^{s}\) penalizes abrupt depth changes while preserving image edges and appropriately weighted and used as part of the total loss calculation, where \(\lambda_{s}\) is a weighting factor for scale s, typically with larger weights assigned to higher-resolution predictions. The final loss function used to optimize the DI-MDE framework is a combination of the photometric consistency loss, depth smoothness loss, and scale-alignment loss, as well as any additional regularization terms for specific tasks. \[L_{T}=\lambda_{photo}L_{photo}+\lambda_{smooth}L_{smooth}+\lambda_{scale}L_{ scale}+\lambda_{multi-scale}L_{multi-scale} \tag{16}\]  
Here, \(\lambda_{photo}\), \(\lambda_{smooth}\), \(\lambda_{scale}\), and \(\lambda_{multi-scale}\) are hyperparameters that balance the contribution of each loss term, where \(L_{photo}\) is the photometric consistency loss, \(L_{smooth}\) is the depth smoothness loss, and \(L_{scale}\) is the scale-alignment loss. These hyperparameters are tuned to achieve the best performance during training. The self-supervised training process begins with input and initialization, where the network receives a sequence of monocular video frames. The depth network predicts an initial depth map for the reference frame, and the pose network estimates the relative camera motion between consecutive frames. Next, in the depth prediction and warping step, the predicted depth map and camera motion are used to warp the source frame to match the reference frame, producing a synthesized image. Loss computation follows, where the photometric consistency loss is calculated between the reference image and the synthesized image, while the smoothness loss ensures smooth depth predictions in low-gradient regions. Additionally, the scale-alignment loss ensures consistency between the depth scales of dynamic and static regions. The depth predictions are then iteratively refined using the iterative elastic bin refinement strategy, with each iteration progressively improving the estimates. Finally, the total loss function is used to update the network parameters via backpropagation, and the training proceeds for a set number of epochs until convergence. The self-supervised training framework of the DI-MDE method leverages photometric consistency between consecutive video frames to supervise depth prediction. The use of multi-scale depth predictions, smoothness constraints, and scale alignment ensures that the depth estimates are accurate and consistent across both static and dynamic regions. This framework enables the DI-MDE network to learn from large-scale unlabeled video data, making it highly scalable and applicable to a wide range of real-world scenarios.