## 4 Multi-Objective Segmentation and Localization Method for Tomato Plants
### Experimental Workflow  
The identification of tomato plants and the localization of axillary bud removal points can be summarized as Algorithm 1.  
```
0: Tomato plant image data Output: Multi-target mask map of a tomato plant; Coordinates of tomato axillary bud removal points; for each t ranging from 1 to the last tomato plant image N 1. Image pre-processing, standardization, resizing;
2. Implement encoder feature extraction based on the left half of Figure 5;
3. Implement a featured decoder based on the right half of Figure 5, perform pixel-level segmentation of the tomato plant image;
4. Obtain the masked images for segmentation of tomato plant main stem, lateral branches, and axillary buds;
5. Convert the masked image to HSV color space;
6. The yellow color range was extracted to obtain a binary graph containing only the axillary bud region;
7. Based on 6, morphological operations were used to obtain the binary graph after fine segmentation of axillary buds;
8. The Canny algorithm was used to find the contour of the binary image;
9. For each contour region in the binary segmented image: a. left_point, right_point, centre_point = CalculateContourPoints(contour); b. Determine whether the axillary bud (contour) is on the left or right side; If on the left: The take point for the axillary bud is 1/4 from the right endpoint to the midpoint; Else: The axillary bud removal point is 1/4 th from the left endpoint to the midpoint; c. Predicted axillary bud removal points in tomato plant images; End for
```  
**Algorithm 1**Multi-target identification and localization of tomato plants based on the VGG16-UNet model  
According to Algorithm 1, the steps for the multi-target segmentation and localization of tomato plants using the example image in Figure 8a are detailed as follows.  
In step 1, the image is pre-processed by denoising, adjusting the brightness and contrast, and resizing it to obtain a standardized image ready for input into the VGG16-UNet model. In step 2, the pre-processed image is fed into the encoder section of the VGG16-UNet model to extract image features. In step 3, a pixel-level semantic segmentation of the tomato plant image is performed by the decoder section of the model to obtain a segmentation mask image (Figure 8b), where different colors represent different regionssuch as main branches, lateral branches, and axillary buds. Next, in step 5, the segmentation mask image is converted from the RGB color space to the HSV color space for more accurate color information processing (Figure 8c). In step 6, based on the yellow threshold in the HSV color space, a binary mask containing only the axillary bud region is generated (Figure 8d). In step 7, morphological operations such as erosion and dilation are applied to the binary mask image to remove noise and more precisely define the axillary bud region, resulting in a refined binary image (Figure 8e). Using the Canny algorithm (step 8), contours are detected in the refined binary image, and key points for each contour, including the left endpoint, right endpoint, and centroid, are calculated (step 9a). Based on these points, the position of the axillary buds is determined, and the removal points are calculated (step 9b), which are then marked in Figure 8f. Finally, in step 9c, the calculated axillary bud removal points are marked on the original image, resulting in the final image (Figure 8g), which will guide automated agricultural robots in precise axillary bud pruning.