In the agricultural domain, among the CNN-based detection frameworks, the two-stage target detection algorithm Faster R-CNN is undoubtedly one of the most widely used. For instance, [PERSON] et al. proposed an improved Faster R-CNN detection model for the field robotic platform (FRP), which can quickly and accurately detect corn seedlings at different growth stages in complex field operations, with an accuracy rate of 97.71% [16]. [PERSON] et al. used focal loss to improve the Faster R-CNN detection model for automatic hydroponic lettuce seedling target detection, with an average accuracy of 86.2 [17]. It can provide amazing performances in detecting single objects and multiple objects at the same time. However, Faster R-CNN will suffer from its two-stage strategy: region proposal networks (RPNs) to generate high-quality region proposals and classification networks to predict the final object. It is not satisfactory for the recognition of small targets and overlapping objects, and the detection speed is slow when processing high-resolution images, which usually cannot meet the needs of real-time detection. On the other hand, the YOLO framework uses a single-stage strategy, and performs classification and regression directly to detect objects in images, thus accelerating the detection tasks. [PERSON] et al. used YOLOv3 as a machine vision system to detect apples in orchards for a harvesting robot with an average detection time of 19 ms [18]. [PERSON] et al. used the lightweight EfficientNet-B0 network to improve YOLOv4, the accurate identification of apples in complex environments, with an average accuracy of 93.42 and a recognition speed of 63.20 frames per second [19]. [PERSON] et al. proposed canopy-attention-YOLOv4 to accurately detect immature and ripe apples in an orchard environment in a complex environment, with a 3% improvement in fruit count compared to the original YOLOv4 [20]. In addition, researchers have detected and classified other types of fruits such as citrus, tomatoes, blueberries, cherries, and kiwis [21; 22; 23; 24]. In the latest research, [PERSON] et al. improved YOLOv5s and proposed the YOLOv5-CS (Citrus Sort) model, which can accurately detect green citrus in the natural environment with an accuracy of 98.23. The model inference speed was 0.017 s on the server and 0.037 s on an Nvidia Jetson Xavier NX [25]. [PERSON] et al. proposed a YOLOv5-based citrus fruit ripeness method to identify three ripeness levels of citrus fruits. The accuracy of this method was 95.07%, which is convenient for the selective harvesting of citrus picking robots [26]. Currently, most researchers have focused on improving the detection performance of a single growing period of a single variety of fruit. However, there are few studies on the identification of different ripening stages of multi-variety citrus. Therefore, it is necessary to provide an automatic detection algorithm that can not only ensure the detection speed, but also has high precision and robustness, and can meet the requirements of various citrus fruits in different growth stages. The main purposes of this study included:  
1. Improving the original YOLOv5 network architecture with a visual attention mechanism coordinated attention module (CA) and weighted feature fusion BiFPN;
2. Comparing the performance of the improved YOLOv5 with other commonly used object detectors including Faster R-CNN, YOLOv4, and original YOLOv5; and
3. Developing a robot fruit detector for precision agriculture applications such as yield estimation and mechanical harvesting, where such a detector can adapt to different varieties of citrus trees and different growth stages under a natural environment.