# Grapevine Branch Recognition and Pruning Point Localization Technology Based on Image Processing
## 4 Discussion  
### Analysis of Semantic Segmentation Results and Target-Detection Results  
After evaluation, PSP-net excels in mIoU metrics, outperforming deeplabv3+ by 1.95%, demonstrating the best image segmentation. Meanwhile, PSP-net also shows excellent performance in terms of frame rate (FPS), with 50.11% and 20.87% improvement compared to U-net and deeplabv3+, respectively. It can be seen that PSP-net has the best segmentation effect and segmentation speed and can process images faster and save computational resources when it is close to the segmentation effect of U-net, which means that PSP-net can be used for real-time monitoring of grapevine branches and can also provide accurate branch shapes for skeleton refinement. Under front back shaded three lighting conditions, PSP-net shows good segmentation effects, which means that the lighting conditions have  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Real Pruning Points** & **Predicted Pruning Points** & **Identification Success Rate** \\ \hline
102 & 84 & 82.35\% \\ \hline \hline \end{tabular}
\end{table}
Table 7: Pruning-point-identification results.  
Figure 14: (**a**–**c**) represent the correct identification of pruning points under three lighting conditions: front light, back light, and shaded light. Red dots represent pruning positions.  
Figure 15: (**a**) The bud is directly behind the branch. (**b**) The bud is obscured by a fixed wire. (**c**) The bud is to the side and behind the branch. Red dots represent correct pruning positions while blue dots represent incorrect pruning positions.  
no obvious effect on the segmentation effect and the algorithm has good generalization ability and can be applied in the grape orchard in complex situations.  
After evaluation, we find that the F1 value of YOLOv5 improved by 26.98% compared to YOLOv4; the Recall of YOLOv5 improved by 21.49% compared to YOLOv7; meanwhile, the FPS of YOLOv5 improved by 56.62% compared to YOLOv3. YOLOv5 achieved a good balance between precision and recall and was able to take into account both the accuracy and coverage of the prediction results. YOLOv5 acted on the PSP-net segmented image with good results, was not much affected by the lighting conditions and also had good generalization ability and was able to act on the complex situation of the grape orchard. Due to the small bud targets and the similarity of the color with the background and branches, when the YOLOv5 target-detection algorithm was directly applied to the original image, the recognition rate of buds was low and it was more difficult to locate the pruning point according to the position of the second bud. And after PSP-net segmentation of the image and then recognition, the recognition effect is very good. It still has high accuracy and coverage in the case of being further away from the branch position, thinner branches and smaller buds, and can cope with the situation that the machine needs to be at a larger distance from the plant during actual pruning.  
In terms of bud identification, when comparing the method proposed in this paper with that of [PERSON] et al. [34], we find that in their best results, the Precision reached 1, while the Recall ranged between 0.38 and 0.45. This means that in their method, there are no false detections. In contrast, the method of this paper achieves a Recall rate of 77.78% for bud identification, which is an improvement of at least 72.84 percentage points compared to the method of [PERSON] et al. Further, when comparing the method of this paper with that of [PERSON] et al. [35], it can be noticed that they took special measures in data collection, i.e., placing white cloths behind the vines in order to eliminate the actual background interference. The dataset used in this paper, on the other hand, is based entirely on a complex background in a natural environment. The method in this paper can still maintain high recognition performance under the complex background, which is closer to the actual application.