## 4 Experiments and Analysis of Results
### Ablation Studies  
To evaluate the impact of the CBAM and depth-separable convolutions, experiments were conducted on a self-built dataset of 10,000 high-resolution crop pest images described in Section 4.2, with data partitioned using five-fold cross-validation to ensure statistical robustness and mitigate sampling bias. Training parameters were standardized across configurations, including a batch size of 16, a learning rate of \(1\times 10^{-4}\), and the hardware environment detailed in Section 4.1. In convergence analysis, the baseline U-Net exhibited slow and unstable convergence, requiring 300 epochs to stabilize at a plateau loss of \(0.12\pm 0.015\), as shown in Figure 7; its loss reduction rate was just 0.0004 per epoch, accompanied by significant early-training fluctuations that indicated challenges in capturing complex spatial-spectral patterns. In contrast, the improved U-Net achieved rapid and stable convergence, reaching a loss of 0.02 within 100 epochs and stabilizing at \(0.008\pm 0.002\) after 150 epochs, as shown in Figure 8. This represented a 93% loss reduction compared to the baseline at the same training stage, with a normalized loss reduction rate of 0.0018 per epoch--4.5 times faster than the baseline--highlighting the efficiency gains from architectural modifications. Figure 7: Plot of U-Net loss function before improvement. Quantitative performance metrics further validated the improved model's superiority: it outperformed the baseline in key segmentation indicators listed in Table 2. The Dice coefficient rose to 91.76% \(\pm\) 0.82%, a 3.4% absolute improvement that signified better preservation of lesion boundaries, while the pixel-wise F1-score increased to 92.45% \(\pm\) 0.67%, a 2.87% gain reflecting enhanced balance between precision and recall for small and irregular lesions. Efficiency validation showed that despite integrating attention mechanisms, the improved U-Net maintained comparable inference speed, demonstrating that depth-separable convolutions effectively mitigated the computational overhead introduced by the CBAM. The stable loss curve of the improved model with minimal fluctuations confirmed a reduced risk of overfitting, a critical advantage for real-world agricultural deployments where labeled data may be limited. This combination of accelerated convergence, improved segmentation accuracy, and efficient computation underscores the effectiveness of the proposed modifications in enhancing U-Net's performance for crop pest recognition tasks. Meanwhile, to validate the complementary advantages of the proposed combination, controlled experiments compared three configurations: YOLOv7-only (original YOLOv7 integrated with SE module for channel attention), U-Net-only (improved U-Net incorporating CBAM attention and depth-separable convolutions), and the Combined Model (integrated YOLOv7-U-Net architecture with feature fusion between detection and segmentation branches), as shown in Figure 9.  
The comparative metrics are presented in Table 2. The combined model outperforms standalone YOLOv7 in mAP and IoU, demonstrating enhanced localization accuracy through U-Net's detailed segmentation. Meanwhile, it surpasses U-Net-only in detection speed and recall, proving YOLOv7's contribution to real-time detection capability. Figure 8: Plot of improved U-Net loss function. To address the need for segmentation-specific metrics, the combined model achieved a Dice coefficient of 91.76% and pixel-wise F1-score of 92.45%, outperforming U-Net-only by 3.53% and 2.87%, respectively. This improvement demonstrates enhanced boundary localization through YOLOv7's feature fusion mechanism. Detection metrics like [EMAIL_ADDRESS] also improved by 2.02% compared to U-Net, validating the complementary benefits of integrating detection and segmentation branches. The combined model achieves 1.56% higher mAP than YOLOv7 by leveraging U-Net's semantic segmentation to refine ambiguous object boundaries.