The fragrant pear is the characteristic fruit of Xinjiang,especially the fragrant pear because of its thin skin,fine flesh and sweet taste and juicy,melt in the mouth and well-known at home and abroad.In the harvest,storage,transportation and other links will be squeezed,collision,vibration and other injuries easily caused by the surface damage of fragrant pear,fragrant pear surface damage is easy to breed germs,accelerating fragrant pear rot and quality deterioration,which affects the quality of fragrant pear,affects the benefits of farmers and related enterprises,and restricts the development of fragrant pear industry.With the rapid development of deep learning,its technology in the field of target detection is becoming more and more mature,this paper takes fragrant pear as the research object,and uses the target detection technology to detect fragrant pear rot,which provides some technical support to fragrant pear related industries.(1)Firstly,in this paper we collect and label images as well as build a dataset,and perform data augmentation on the original data to increase the amount of data and improve the accuracy as well as the robustness of the model.The classical algorithm YOLOv5 and SSD in the field of target detection are selected to detect the surface rot of fragrant pear dataset,the algorithm with better comprehensive performance is selected as the base network.The experimental results show that the mAP of YOLOv5 reached 97.8% and the model size is 13.7M.Finally,the YOLOv5 model is selected as the base network for subsequent improvement and optimization.(2)Secondly,YOLOv5 algorithm is improved.When the aspect ratio of CIOU prediction frame and real frame is linear,the prediction frame width and height cannot increase or decrease at the same time,resulting in the model cannot converge well.SIoU introduces the angle information between two bounding boxes on the basis of CIoU,which solves this kind of problem better.This paper adopts SIOU Loss as the loss function.In order to reduce the computation,the YOLOv5 backbone network is replaced by MobileNetV3 to make the model lighter.In order to improve the model detection accuracy,CBMA,an attention mechanism,will be introduced into the YOLOv5 model to improve the feature extraction capability of the model.(3)Finally,the experimental results show that in the detection of surface rot of fragrant pears,the mAP of YOLOv5 reached 97.8%,and the mAP of YOLOv5-MCS reached 98.5%.Compared with YOLOv5,the average accuracy increased by 0.7%,and the model size was reduced,which effectively improved the model detection accuracy while minimizing the model size. |