Abstract:Aiming to address the challenge of estimating the variable pose of citrus in orchard environments and enhance the citrus harvesting success rate, a lightweight target detection network, YOLO v5-MNv4S, along with an improved random sample consensus-Gauss Newton (RANSAC-GN) point cloud processing algorithm was introduced. The citrus pose was defined based on actual citrus growth and the final harvesting process, constructing a real-time citrus pose estimation system. The YOLO v5s backbone network was optimized to be a lightweight feature extraction network (MNv4- Conv-S), which significantly reduced the training parameters so that the final output network weights were lightweight, reducing the amount of computation and improving the recognition efficiency. Additionally, the CA attention mechanism was incorporated, and the loss function was replaced with SIoU, addressing the weak feature extraction ability of the lightweight network. These improvements resulted in a lightweight YOLO v5-MNv4S network with superior detection capabilities compared with YOLO v5s. After the D435i image acquisition, YOLO v5-MNv4S was input to detect the target bounding box by using the pinhole model to output the citrus regional point cloud, segment the citrus surface point cloud, combined with the improved RANSAC-GN point cloud algorithm to fit accurate and stable citrus parameters, then fusion of the stemend spatial coordinates, and ultimately the output of citrus spatial pose results to be harvested. Ablation experiments and network comparisons demonstrated that the lightweight YOLO v5-MNv4S achieved 93.1% accuracy, with only 14.7% of the parameters found in YOLO v5s. Compared with YOLO-Ghost, YOLO v7, YOLO v8, and other networks, it offered the best recognition accuracy with significantly reduced parameters. Experimental results for citrus localization and pose recognition showed that the citrus parameter fitting error using RANSAC-GN was (0.18,0.19,0.44) mm, and the pose estimation error was 2.56°. The pose estimation was accurate, and the estimation results of citrus pose in real orchard environments were consistent with real citrus. The research result can recognize citrus pose in orchard environments and provide technical support for structured citrus orchard mechanical harvesting equipment.