## 2 Materials and Methods
### Dynamic Kernel Convolution Operation
Unlike Max Pooling, which retains only the most dominant features in each pooling region, Average Pooling preserves a broader range of spatial information by considering all values within the region. This characteristic allows for a more refined representation of shadow regions, reducing information loss and improving segmentation accuracy. The combination of dynamic kernel adjustment and modified downsampling results in a more adaptable model that can effectively balance fine-detail preservation with global feature extraction, outperforming approaches that rely on pre-defined kernel configurations. In this proposal, the IoU validation metric is utilized to guide the kernel size adjustment process dynamically. Figure 5 illustrates the IoU evaluation mechanism used for dynamically varying kernel sizes based on the IoU validation metric. In this diagram, \(P_{u}\) (_patience counter for UP_) and \(P_{d}\) (_patience counter for DOWN_) regulate changes in the kernel size (\(k\)). Specifically, \(P_{u}\) increments when the improvement in IoU is not significant, suggesting stagnation, while \(P_{d}\) increments when IoU decreases, indicating a potential decline in performance. These counters determine when an increase or reduction in \(k\) is triggered. \(P_{o}\), which is used to determine when to change the optimizer, is discussed in the optimizer-switching process and is controlled by a distinct process illustrated in Figure 6. The primary input is the IoU obtained from the current epoch. As IoU validation valuestend to oscillate during training, the condition is designed to focus on substantial improvements rather than minor fluctuations. In cases where the condition \(\mathrm{IoU[i]}>1.075*\mathrm{BIoU}\) is met, **BIoU** stores the best IoU observed at epoch \(i\), and all patience counters are reset to zero, ensuring that the algorithm retains the most favorable performance metric as a reference point. This reset also helps to distinguish significant improvements from minor oscillations in IoU validation values during training. The condition \(\Delta IoU<0\) is used to detect whether the IoU has decreased or is stagnating. If true, the corresponding patience counters \(P_{u},~{}P_{d}\) and \(P_{o}\) are incremented, preparing the system to adapt dynamically. This methodology ensures a balanced approach, capturing meaningful IoU improvements while dynamically adjusting kernel sizes and optimizers to maintain efficient training and convergence. At this stage of the process, the main outputs are the updated patience counters \(P_{u}\), \(P_{d}\), and \(P_{o}\), which guide the subsequent adjustments in the kernel size adjustment process and optimizer adjustment process. After the IoU evaluation process, _the kernel adjustment mechanism_ is executed, as illustrated in Figure 7. This process takes the previously calculated patience counters at a specific epoch \(P_{u}\) and \(P_{d}\) as inputs to determine whether the patience thresholds for modifying the kernel size have been reached. Specifically, \(P_{ku}\) denotes the patience value required to trigger an increase in kernel size, set to 10, while \(P_{kd}\) corresponds to the patience  
Figure 5: IoU evaluation process used to dynamically adjust kernel sizes and optimizers based on validation metrics. value for decreasing the kernel size. When either of these thresholds is reached, all patience counters are reset to zero, and the appropriate kernel size adjustment is applied. This method ensures a systematic adaptation of the kernel size, balancing feature extraction capabilities with computational efficiency. Figure 6: Optimizer-switching mechanism alternating between Adam and Nadam based on model performance metrics. Figure 7: Kernel size adjustment process based on patience counters and IoU performance metrics during training.