## 2 Materials and Methods
### Combined Loss Function  
Class imbalance presents a significant challenge in shadow detection within remote sensing, as shadowed regions often occupy a much smaller proportion of an image compared to non-shadowed areas. This disparity can bias models toward the majority class (non-shadowed regions), thereby reducing segmentation performance for the minority class (shadowed regions). As illustrated in Figure 3, where white areas represent shadowed regions, this imbalance is evident in an example extracted from the AISD dataset. Shadowed regions are considerably underrepresented compared to non-shadowed regions. Specifically, for this dataset, non-shadowed regions constitute approximately 78.94% of the data, nearly \(\times 4\) the prevalence of shadowed regions. These findings highlight the necessity of implementing strategies to address class imbalance and enhance model performance, particularly for detecting underrepresented shadowed regions. In this work, a combined loss is proposed, where the algorithm utilizes both Focal Loss and Tversky Loss. Focal Loss is a specialized loss function designed to mitigate the influence of well-classified, non-shadowed pixels, allowing the model to concentrate on harder-to-classify shadowed regions. By down-weighting easy examples, Focal Loss helps balance the training process, effectively classifying complex shadow areas. The formula for Focal Loss is shown in Equation (1). \[F_{L}=\alpha(1-p_{t})^{\gamma}\text{log}(p_{t}) \tag{1}\]  
where \(p_{t}\) is the predicted probability for the correct class, \(\alpha\) the balancing parameter to address class imbalance, and \(\gamma\) the focusing parameter to down-weight the loss of well-classified examples. For this approach, the values are defined as \(\alpha=0.25\) and \(\gamma=2\); this  
Figure 2: Architecture of SDKU-Net featuring dynamic kernel adjustments, Batch Normalization (BN), and residual connections for optimized segmentation. emphasizes hard-to-classify examples' complex shadow details. However, Focal Loss may underperform for small regions due to no spatial weighting; for this reason, we the use of an additional loss function in this approach. Following this, Tversky Loss can be introduced to emphasize its complementary role in reinforcing compensation for class imbalance, further enhancing the model's sensitivity to underrepresented shadowed regions. The use of this loss function allows the model to improve the segmenting of small, imbalanced regions. The Tversky Loss function generalizes the Dice coefficient by introducing weights to control the balance between false positives (FPs) and false negatives (FNs). It is particularly effective for imbalanced datasets. The formula is shown in Equation (2). \[T_{L}=1-\frac{TP+\delta}{TP+\lambda FN+\beta FP+\delta} \tag{2}\]  
where \(TP\) are the true positives, \(FP\) denotes false positives, \(FN\) stands for false negatives, and \(\delta\) is a small constant used to avoid division by zero. In this context, \(\lambda\) acts as the weight for false negatives, while \(\beta\) regulates the penalty for false positives. This parameterization allows the model to explore a broader range of possible shadow regions during training. In our experiments, we established the values \(\lambda=0.7\) and \(\beta=0.3\); these specific values lead the model to prioritize the detection of small shadow regions, thereby improving its sensitivity to underrepresented classes. Consequently, the proposed combined loss function is defined as shown in Equation (3). \[C_{L}=0.5*F_{L}+0.5*T_{L} \tag{3}\]  
As shown in Equation (3), a proportional sum combines Tversky and Focal Loss. This method enables each loss component to contribute to the total loss without affecting their individual scales. Consequently, the model is inclined to prioritize the loss that dominates during each training epoch.