Publications
Sort:
Issue
Detecting grape in an orchard using improved YOLOv5s
Transactions of the Chinese Society of Agricultural Engineering 2023, 39(18): 192-200
Published: 30 September 2023
Abstract PDF (2.2 MB) Collect
Downloads:1

Grape has been one of the most popular fruits with great nutritional value and economic benefits. Manual picking of mature grapes cannot fully meet the large-scale production in recent years, particularly with the expansion of planting areas. A picking robot can be expected to monitor the growth of grapes in orchards in real time. Automatic grape picking can also be promoted to realize intelligent agricultural production. In this study, an improved YOLOv5s model (MRW-YOLOv5s) was proposed to rapidly and accurately identify the grapes in orchards. Firstly, the lightweight network MobileNetv3 was used as the feature extraction network, in order to reduce the amount of model parameters. A coordinate attention module (CA) was also embedded into the bneck structure of MobileNetv3 to strengthen the feature extraction capability of the network. Secondly, RepVGG Block was introduced into the neck network, where the multi-branch features were integrated to improve the detection accuracy of the model. Moreover, the structural reparameterization of the RepVGG Block was implemented to further accelerate the inference speed of the model. Finally, Wise Intersection over Union Loss (WIoU Loss) with the dynamic non-monotonic focusing mechanism was taken as the bounding box regression loss function, in order to accelerate the network convergence for the better detection accuracy of the model. Gradient-weighted class activation mapping (Grad-CAM) was also selected to capture the grape targets when the backbone network of the improved model was embedded with the CA module. A better performance was then achieved, compared with the model embedded with Efficient Channel Attention (ECA) and Convolutional Block Attention Module (CBAM). In addition, there was the lowest speed of bounding box loss regression in the convergence curve of the loss function, while the highest loss value after convergence, where the EIoU was the bounding box loss function. Once the CIoU and Wise-IoU v1 were taken as the bounding box loss functions, there were similar convergence speeds and loss values, indicating a slightly lower value than that of EIoU. Moreover, there was the highest convergence speed of the model and the lowest loss value, when the Wise-IoU v3 was used as the bounding box loss function. Therefore, the Wise-IoU v3 can be expected to accelerate the convergence of the model for better accuracy of the model. The results showed that the number of parameters of the improved MRW-YOLOv5s model was only 7.56 M. The mean Average Precision (mAP) on the test set reached 97.74%, and the average detection time per image was 10.03 ms, which were 2.32 percentage points and 6ms higher than those of the original YOLOv5s model, respectively. The mAP of the MRW-YOLOv5s model was 9.89, 7.53, 2.12, 0.91, and 2.42 percentage points higher, respectively, compared with the mainstream object detection models, such as the SSD, RetinaNet, YOLOv4, YOLOv7, and YOLOX. In terms of the number of model parameters, the improved model was only 7.56 M, which was 68.2%, 79.2%, 88.2%, 79.7%, and 15.4% less than the above five models, respectively. The average detection speed of the improved model was only 10.03 ms, which was 2.64, 13.19, 10.59, 4.14, and 5.46 ms higher than the above five models, respectively. Furthermore, the weight size of the improved model was only 26.97 MB, which was more conducive to model deployment. Therefore, the MRW-YOLOv5s model can greatly contribute to the detection accuracy, parameter size, and detection speed. The finding can also provide technical support for the intelligent orchards and mechanization of picking.

Issue
Detecting pests in cotton fields using improved YOLOv7
Transactions of the Chinese Society of Agricultural Engineering 2024, 40(10): 176-184
Published: 30 May 2024
Abstract PDF (3.7 MB) Collect
Downloads:10

Cotton is one of the largest producing and consuming crops in China. Accurate detection of cotton pests is an important premise for improving the cotton quality. In this study, an ECSF-YOLOv7 pest detection model was proposed to address the high insect similarity and serious background interference in the natural environments of cotton fields. Firstly, EfficientFormerV2 was used as the feature extraction network, in order to strengthen the feature extraction of the network with the smaller number of parameters of the model. At the same time, the convolutional block attention module (CBAM) was embedded in the backbone output of the model, in order to enhance the extraction of small targets and weaken background interference; Secondly, GSConv was used to build a Slim-Neck network structure, which was reduced the number of model parameters while maintaining the recognition accuracy. Finally, Focal EIOU loss was used as the bounding box regression loss function to accelerate the network convergence for high detection accuracy. The dataset was selected as 17 types of insect images in cotton fields. The python scripts were used to enhance the annotated images, including random brightness, random flipping, mirror transformation, and Gaussian noise. The robustness of the model was also improved to build more insect recognition scenes in natural environments. Finally, a total of 6 273 images of the cotton field insect dataset were obtained with sufficient sample quantity and relatively balanced distribution. Four experiments were conducted to verify the excellent performance of the improved model, including ablation experiments, gradient-weighted class activation mapping (Grad-CAM) of attention mechanism, loss function, and mainstream model performance. Ablation experiments showed that the improved modules had a positive effect. The feature extraction of the image also varied, when CBAM was embedded in the different positions of the model. The Grad-CAM was used to generate a heat map of object detection. The region of interest of the heat map was closer to the real pest area, and less affected by background interference when the CBAM was embedded in the backbone output of the model. Five bounding box loss functions were compared: DIOU, EIOU, MPDIOU, CIOU, and Focal EIOU. Since the Focal loss function was combined to automatically adjust the loss weights of different types of samples, the Focal-EIOU bounding box loss function achieved the best overall performance and the highest detection accuracy. The results showed that the mean average precision (mAP) of the ECSF-YOLOv7 model was 95.71%, which was 1.43, 9.08, 1.94, and 1.52 percentage points higher than the mainstream object models YOLOv7, SSD, YOLOv5l, and YOLOX, respectively. The improved model was only 20.82 M in the number of model parameters, which was reduced by 44.15, 12.26, 55.25, and 17.9 percentage points, respectively. The ECSF-YOLOv7 model had an average detection speed of 69.47 frames per second, which was 5.26 frames higher than the YOLOv7 model. The high detection accuracy was also obtained in the situations of insect overlap, high similarity between species, small targets, and background interference. In summary, the ECSF-YOLOv7 model can be expected with high detection accuracy, fast detection speed, and smaller parameter quantity. The finding can provide technical support for the rapid and accurate detection of cotton field pests.

Total 2