Abstract:In response to the low accuracy of cherry tree image segmentation and diameter calculation in orchard environments, a dormant cherry branch diameter calculation method was proposed based on improved UNet. Firstly, the main trunk and branches of cherry trees were classified and grided to increase the training capacity of UNet on branch data. Secondly, VGG16 with strong universality was selected to replace the backbone feature extraction network of UNet, and a SAM module was added after the pooling layer to overcome the influence of complex backgrounds and branch structures. Again, using a weighted cross entropy loss function, assigning different weights to various targets to solve the problem of imbalanced pixel categories. Finally, the maximum inscribed circle was generated in the branch mask image obtained by UNet, and the actual diameter of the branch was calculated based on the maximum inscribed circle diameter. The experimental results showed that the improved UNet model achieved an MPA and MIoU of 85.79% and 77.97% for detecting dormant cherry trees, respectively, which were 0.52 percent points and 4.49 percent points higher than that of the original UNet model. Linear regression analysis was conducted between the described method and the field measurement method, and the determination coefficients of the branch diameter calculation results were all no less than 0.915 7, with root mean square errors no more than 0.86 mm. This indicated that the method proposed can accurately segment cherry tree branch images, calculate branch diameters, and provide effective technical support for automated pruning of cherry trees.