| Wild shiitake mushrooms have high nutritional and medicinal value,and are an important component of the shiitake mushroom industry.Traditional manual harvesting is inefficient and poses certain risks.Deep learning model makes the application of unmanned pickup equipment possible,but the classical target detection model often has large parameter size and large amount of calculation,which is not suitable for low performance embedded device.To address the above issues,an improved YOLOv5 m visual detection model suitable for wild shiitake mushroom detection tasks is proposed,which reduces the number of parameters and improves detection speed while ensuring accuracy to meet the needs of embedded devices.The main research content is as follows:(1)Constructing a dataset for wild shiitake mushrooms: 800 original images are obtained through on-site photography,network engine search,and other methods.Through dataset partitioning and amplification processing,a training set,a testing set,and a supplementary testing set are obtained,with data volumes of 1280,320,and 320,respectively.Use Label Img software for image annotation,and the K-means++ algorithm performs anchor box clustering for annotation information.(2)Based on comparative experiments,YOLOv5 m is selected as the basic framework,and the lightweight improvement research is carried out.The backbone structure adopts Shuffle Netv2 network;in the neck network,design a BI-ASFF feature fusion structure to reduce network parameters and computational complexity without reducing feature extraction effect;for convolutional layers,design efficient Py-DWConv convolutional blocks to replace ordinary convolutions for lightweight improvement.The experimental results show that after lightweight improvement,the model detection accuracy decreases slightly,the weight size decreases significantly,and the running speed significantly improves.(3)Optimize detection accuracy based on lightweight models.Introduce SA attention module at the network output end;Improve the training loss function and replace GIo U Loss with αDIo U Loss as positioning loss,introducing QFocal Loss as confidence loss and classification loss;In the post-processing process,the Weighted DIo U NMS algorithm is used to optimize the selection process of the prediction box.The experimental results show that after precision optimization and improvement,the model detection accuracy is improved,which basically compensates for the loss caused by model lightweight.The detection speed and weight size are comparable to the lightweight model.(4)Research on the application of detection models,including model pruning research and the development of a wild mushroom target detection software platform.The filter level structured pruning method is selected.After experiments and analysis,the pruning strategy with neck network as the pruning position and pruning rate r=0.5 is selected to further improve the running speed on the premise of ensuring accuracy.In order to improve human-computer interaction,develop the software platform for wild mushroom detection: first design the combination of functional modules,then develop the software according to the functional design,and finally carry out functional verification experiments on the detection page control sub module.The results show that the software platform is highly reliable.Compared with the original model,the weight size of the improved YOLOv5 m model is deeply compressed,and the detection rate is significantly increased.Moreover,the improved Yolov5 m model is superior to other lightweight detection models in terms of detection accuracy and running speed,which can provide theoretical support for the production and development of embedded picking equipment for wild shiitake mushroom. |