Evaluating transformer- and CNN-based semantic segmentation models for sunflower inflorescence identification using a UAV RGB orthomosaic
摘要
Monitoring sunflower inflorescence development is critical for yield assessment and precision crop management. While convolutional neural networks (CNNs) have shown promise in UAV-based crop segmentation, the behavior and practical implications of recent vision transformer architectures for inflorescence-level identification and spatial pattern analysis remain insufficiently explored. This study aims to systematically evaluate transformer-based and CNN-based models for sunflower inflorescence detection and to assess their capability for field-scale spatial characterization.
MethodsA high-resolution UAV orthomosaic was used to evaluate state-of-the-art transformer-based models (SegFormer, Dense Prediction Transformer (DPT), and UPerNet) and CNN-based models (U-Net, DeepLabv3+, and PSPNet). A controlled experimental framework was adopted, in which spatially disjoint training and testing subsets were extracted from the same production field to capture realistic within-field heterogeneity. All models were evaluated using standard performance metrics, including accuracy, precision, recall, F-score, and IoU. Beyond model-level performance comparison, targeted ablation analyses were conducted to examine the influence of key methodological choices, including loss function selection, patch overlap, and data augmentation strategies. In addition, explainable AI analysis (Grad-CAM) and computational cost assessments were performed.
ResultsAmong the 15 evaluated model configurations, the DPT model with the Twins-PCPVT-Base encoder achieved the highest segmentation performance (F-score: 0.946, IoU: 0.897) and demonstrated the most stable behavior across validation and spatially disjoint testing subsets. Explainable AI analysis using Grad-CAM revealed distinct attention patterns between transformer- and CNN-based models, while computational cost analysis highlighted trade-offs between segmentation accuracy and efficiency. To enhance agronomic relevance, object-based segmentation outputs were aggregated into field-scale spatial representations using complementary inflorescence-derived indicators describing inflorescence abundance and size. In addition, a weighted head area index (WHAI) was further introduced to integrate count- and area-based information, providing a balanced, image-derived spatial descriptor of within-field variability in inflorescence development.
ConclusionsTaken together, the results indicate that transformer-based semantic segmentation, when integrated with object-level spatial indicators, enables consistent and interpretable field-scale characterization of within-field variability in sunflower inflorescence development, thereby enhancing the agronomic relevance of UAV-based image analysis for precision agriculture applications.