Recent adaptations for shadow detection in remote sensing images, including multi-scale spatial attention mechanisms [11], global context attention [33], and deep supervision combined with residual connections [34], have further enhanced the network's ability to refine shadow boundaries in complex and heterogeneous environments. However, segmenting shadows remains challenging due to the complexity of both global and local shadow features. An additional challenge in shadow detection is the class imbalance commonly present in remote sensing datasets, where shadowed regions occupy a significantly smaller portion of the image compared to non-shadow areas. This imbalance often leads to reduced model performance. To address this issue, several strategies have been employed, such as data augmentation techniques [35, 36], attention mechanisms [37], dynamic adjustments [38], and specialized loss functions [39, 40, 41], all aimed at mitigating the impact of class imbalance. Nevertheless, the application of these techniques still presents opportunities for further improvements to optimize segmentation results in shadow detection tasks. As mentioned above, the complexity introduced by shadows and unbalanced class distributions makes shadow detection in remote sensing images a challenging yet pertinent research topic. Furthermore, many remote sensing applications require precise shadow detection to ensure the accurate execution of specific tasks. To address these challenges, this research proposes the Supervised Dynamic Kernel U-Net (SDKU-Net), a novel architecture adapted from U-Net for shadow detection. SDKU-Net effectively addresses class imbalance by prioritizing minority classes using Focal and Tversky Loss functions, in contrast to many existing models that rely solely on Binary Cross-Entropy. Additionally, the model integrates a three-layer convolutional operation with dynamically tuned kernel sizes in both the encoder and decoder, alongside residual layers, enhancing its ability to capture both local and global details in shadow regions. The main contributions of this research include the following:  
* Dynamic Kernel Adjustment: SDKU-Net incorporates a dynamic kernel adjustment strategy within its encoder and decoder stages, with kernel sizes adaptively tuned based on validation IoU metrics. This adjustment process is guided solely by validation data, ensuring separation from training data and preventing data leakage while optimizing segmentation results. * Multi-Scale Feature Extraction: By integrating a multi-scale feature extraction mechanism, the model leverages various levels of detail in the input images, improving its understanding of complex shadow patterns and enhancing segmentation accuracy across diverse contexts. * Novel Loss Function: This work introduces a new loss function combining Focal Loss and Tversky Loss to effectively address class imbalance in shadow detection, facilitating effective learning even in datasets with underrepresented shadowed regions. Overall, the innovations in SDKU-Net enhance the model's performance in accurately detecting shadows in remote sensing images and yield promising results on the Aerial Imagery dataset for Shadow Detection (AISD), achieving an Intersection over Union (IoU) of 0.8552, an F1-Score of 0.9219, an Overall Accuracy (OA) of 96.50%, and a Balanced Error Rate (BER) of 5.08%. These results highlight the model's potential to significantly improve shadow detection methodologies and pave the way for advancements in addressing complex visual challenges across various applications.