With the expansion of muskmelon cultivation, manual pollination is increasingly inadequate for sustaining industry development. Therefore, the development of automatic pollination robots holds significant importance in improving pollination efficiency and reducing labor dependency. Accurate flower detection and localization is a key technology for enabling automated pollination robots. In this study, the YOLO-MDL model was developed as an enhancement of YOLOv7 to achieve real-time detection and localization of muskmelon flowers. This approach adds a Coordinate Attention (CA) module to focus on relevant channel information and a Contextual Transformer (CoT) module to leverage contextual relationships among input tokens, enhancing the model’s visual representation. The pollination robot converts the 2D coordinates into 3D coordinates using a depth camera and conducts experiments on real-time detection and localization of muskmelon flowers in a greenhouse. The YOLO-MDL model was deployed in ROS to control a robotic arm for automatic pollination, verifying the accuracy of flower detection and measurement localization errors. The results indicate that the YOLO-MDL model enhances AP and F1 scores by 3.3% and 1.8%, respectively, compared to the original model. It achieves AP and F1 scores of 91.2% and 85.1%, demonstrating a clear advantage in accuracy over other models. In the localization experiments, smaller errors were revealed in all three directions. The RMSE values were 0.36 mm for the X-axis, 1.26 mm for the Y-axis, and 3.87 mm for the Z-axis. The YOLO-MDL model proposed in this study demonstrates strong performance in detecting and localizing muskmelon flowers. Based on this model, the robot can execute more precise automatic pollination and provide technical support for the future deployment of automatic pollination robots in muskmelon cultivation.
Bothriochloa ischaemum is a key forage species with strong grazing tolerance and high nutritional value, making precise quantification of spike and seed traits essential for germplasm evaluation and yield prediction. However, the compact architecture and minute seed size in natural field conditions render manual counting inefficient and labor-intensive. To address this limitation, this study presents a non-destructive and automated quantification framework integrating advanced object detection and regression analysis for accurate in situ estimation of spikes and seed numbers. To further address the challenges of dense spike detection caused by occlusion and small object sizes, this study developed a modified model named YOLOv12-DAN by integrating DySample dynamic upsampling, ASFF feature fusion, and NWD loss, which achieved a mean average precision (mAP) of 91.6%. Meanwhile, for the detection of dense kernels on compact spikes, an improved YOLOv12 architecture incorporating an Explicit Visual Center (EVC) module was proposed to enhance multi-scale feature representation. The optimized model attained a bounding box precision of 96.5%, a recall rate of 86.4%, an mAP50 of 94.3%, and an mAP50-95 of 73.9%. Furthermore, a univariate linear regression model based on 132 spike samples verified the reliable consistency between the predicted and actual seed counts, with a mean absolute error (MAE) of 6.30, a mean absolute percentage error (MAPE) of 9.35, and an R-squared (R2) value of 0.808. Finally, the model was deployed through a lightweight end-to-end web application, enabling real-time field operation and promoting its applicability in breeding programs and agronomic decision-making. This study provides a robust technical pathway for automated phenotyping and precision forage improvement.