# An Enhanced YOLOv5 Model for Greenhouse Cucumber Fruit Recognition Based on Color Space Features
## 4 Discussion
### Result Analysis  
Although most of the previous studies that used machine learning to extract the object from the near-color background achieved high accuracy, the methods were time-consuming and highly dependent on the researchers' experience not only in RGB images, but also in spectral images [35; 36]. In order to eliminate reliance on professional experience, this study weighted the feature information through the ReliefF method to choose the color channel based on the difference between cucumber fruit and the near-color background. Then, the deep learning model was trained by channel with the highest weight to enhance the recognition ability. Similar research was conducted by [PERSON] et al. [37]. They improved the accuracy of green apple detection to 90.12% using the \(Cr\) channel. However, the \(Cr\) channel was used after the application of the YOLOv3 model. Therefore, their method still relies on the detection ability of the YOLOv3 model instead of enhancing the detection ability of the model for the ground truth.  
Compared to the YOLOv3 and YOLOv4, some of the improvements in YOLOv5 model play a necessary role in this study. At every epoch, the YOLOv5 adaptive anchor frame computation algorithm can adjust the size of the anchor frame to match the cucumber. However, in YOLOv3 and YOLOv4, the size of the anchor frame is a constant. Besides, the YOLOv5's unique structure (Focus) makes it easier to extract the feature of cucumbers. And lastly, due to the loss function (CIOU_Loss & DIOU_nms) for bounding box used in YOLOv5, the parallel overlapping cucumber fruits can be distinguished easier.  
As shown in Table 3, the precision of the YOLOv5l and YOLOv5x versions was lower than that of the YOLOv5m version. It is because the depth of the YOLOv5 model network in the l and x versions is larger than in the m and s versions. Furthermore, compared with the lightweight and miniaturized network of the m version, it is easier for the l and x versions to lose feature information, resulting in a decline in accuracy. In this case, the performance of object detection does not necessarily improve with the depth of the network. For datasets with more low-dimensional features, lightweight and small networks may have better results.  
The average recognition precision (Figure 8) from various color space training models under the same circumstances demonstrates that the color information of the \(Cr\) channel enabled cucumber fruits and leaves to be distinguished more easily than with the other color spaces. This was consistent with the outcomes of the weight analysis process (Figure 7). The result of this paper is also in line with previous studies [38; 39; 40]. The authors offer two reasons as to why the \(Cr\) condition achieved the best performance among the others. (1) The \(Cr\) channel takes out the effect of illumination [40] because the \(Cr\) channel is the red component (\(R\)), eliminating the luminance component (\(Y\)) (Equation (7)). Therefore, the Cr channel is more suitable for studying images under different exposures. (2) The \(Cr\) channel, a chrominance component for red [41; 42], eliminates the disturbance of the green chrominance component for segmentation in near-color backgrounds [39].  
The results of this study demonstrate that adding the \(Cr\) channel improved the ability of YOLOv5s model to recognize cucumber fruits. However, the precision only increases marginally from 83.7% to 85.19%. This is due to the fact that the information of the Cr channel is lost anyway throughout the formal training process as the network weight continues to converge to the RGB color space over hundreds of cycles. Additionally, the loss of feature information results from the depth of the network layers.