YOLOv11-BSD: Blueberry maturity detection under simulated nighttime conditions evaluated with causal analysis - Runqing Zhang; Wenhui Dong; Pengzhi Hou; Huiqin Li; Xiongwei Han; Qingqiang Chen; Fuzhong Li; Xiaoying Zhang (Smart Agricultural Technology)
Accurate blueberry maturity classification is vital for the berry industry, affecting quality, shelf life, and processing efficiency. Current methods mainly use deep learning under good lighting, but nighttime harvesting better preserves freshness. However, capturing nighttime images is tough, and existing models fail to adequately extract key features. Moreover, current evaluation metrics fail to effectively assess model robustness. To address these challenges, this study proposes an improved model, YOLOv11-BSD: it enhances the C3k2 module with a Bi-directional Feature Attention Mechanism to strengthen feature representation capabilities; enhances the C2PSA module using an Squeeze-and-Excitation mechanism to heighten focus on critical channel features; optimizes the PANet feature fusion pathway to improve multi-scale feature integration; and introduces the DySample module to resolve feature adaptation issues during upsampling. Additionally, the Relative Causal Effect metric is incorporated to comprehensively and accurately evaluate model robustness from a causal inference perspective. For data preparation, blueberry images captured during the daytime were processed using image enhancement techniques to simulate nighttime lighting conditions, and the original daytime images were combined with the simulated nighttime images for model training.The experimental results demonstrate that the performance of the improved YOLOv11-BSD model is significantly better than that of the original model. Its Precision reaches 89 %(+5.4 %); the Recall reaches 85.7 %(+5.6 %); the mean Average Precision at IoU=0.50 reaches 91.8 %(+4.7 %); the mean Average Precision across IoU thresholds from 0.50 to 0.95 reaches 80.8 %,(+5.7 %). Meanwhile, the Relative Causal Effect drops to 18.98 %(-4.26 %). The model shows significant improvements in both accuracy and robustness.