## 2 Materials and Methods
### Dynamic Kernel Convolution Operation  
The proposed model is built on the U-Net architecture, which integrates a convolution operation module designed to implement a residual block consisting of three convolutional layers, BN, and ReLU activations. Figure 4 illustrates the convolution operation process, highlighting the shortcut connection, dynamic convolutions, and residual additions. The shortcut connection is established by applying a \(1\times 1\) convolution to the input. This operation ensures that the number of feature channels in the input matches those of the output from the convolutional layers, enabling proper residual addition without altering the spatial dimensions of the feature maps. The dynamic convolution block comprises three convolutional layers, each utilizing a Conv2D operation with kernel sizes  
Figure 4: Diagram of a dynamic convolutional block with residual addition, where the blue block represents the input feature map, the purple blocks correspond to the dynamic convolutional layers with kernel sizes, each followed by Batch Normalization (BN) and a ReLU activation, the light blue block represents the shortcut connection convolution and, The gray block corresponds to the final output after residual addition and ReLU activation..  
of \((k-1)\times(k-1)\), \(k\times k\), and \((k+1)\times(k+1)\). This design allows the network to capture spatial features at multiple scales throughout the training process. In this regard, smaller kernel sizes allow the network to focus on local features, which is beneficial for tasks that require improved edge detection or subtle texture recognition. Larger kernels can capture broader contextual information but may miss finer details. Each convolutional layer is followed by BN and a ReLU activation. In the residual addition block, the shortcut connection is summed with the output of the dynamic convolution, followed by a ReLU activation. The final output, represented by the gray block in Figure 4, is outside the convolution operation function and is obtained after this activation. This convolution operation is utilized in both the encoder and decoder phases of the U-Net. In the encoder, this block extracts features from the input image at various resolutions, with dynamic kernel sizes adjusting during training to enhance performance and capture features at different scales [42]. In the decoder, the block is applied after upsampling layers to refine the reconstructed features, ensuring spatial details are preserved while leveraging the features learned in the encoder. The kernel size is a critical hyperparameter that significantly influences the performance and computational efficiency of convolutional neural networks. Larger kernels expand the receptive field, enabling the model to capture broader contextual information, which is beneficial for detecting global patterns in the data [43]. However, the computational cost grows quadratically with the kernel size (\(O(k^{2})\)), where \(k\) is the kernel size), making larger kernels more resource-intensive. Unlike systems trained with a fixed set of kernel sizes (k = [1, 7]), the proposed method dynamically adjusts the kernel size based on validation IoU, ensuring an adaptive feature extraction process that evolves throughout training. This eliminates the need for multiple training runs with different fixed kernel configurations, improving computational efficiency while allowing the model to optimize feature extraction in real time. Furthermore, the dynamic adjustment refines the receptive field throughout training, enhancing generalization to diverse shadow structures and reducing the risk of overfitting. Additionally, this approach leverages smaller kernels in the initial layers to efficiently capture fine-grained details while progressively incorporating larger kernels when required for higher-level feature abstraction. This balance maintains computational efficiency while increasing feature diversity [42]. Moreover, a separate modification in the downsampling process replaces Max Pooling with Average Pooling.