| Bagging cultivation is a common cultivation method of lentinus edodes,and computer vision identification of lentinus edodes is an indispensable part of exploring mechanical picking,especially in the production environment,lentinus edodes occlusion,adhesion,luminance and other factors bring certain difficulties to the machine vision identification of lentinus edodes.Therefore,this paper adopts the one-stage YOLO correlation algorithm commonly used in the industry as the research focus,and proposes a shiitake mushroom detection model based on YOLO v5 algorithm.The main work of this paper is as follows:First,the experimental data set is established.A variety of algorithms are used for training,combined with the loss function decline,analysis of three factors including detection accuracy,detection speed and the number of algorithm parameters,and select the algorithm with the best comprehensive performance as the improved starting algorithm.In order to solve the variable brightness problem of data image,an improvement in image preprocessing is proposed,that is,a brightness Equalization algorithm combining threshold segmentation and gamma inverse mapping is used to adjust the brightness,and Automatic color equalization(ACE)is used to enhance the color.Furthermore,Co Co data sets were introduced into the backbone network to enhance the generalization of the model,and the detection accuracy of the algorithm was improved by freezing and retraining and other parameter fine-tuning operations.In the comparison experiment,the influence of correlation preprocessing algorithm and transfer learning method on the detection accuracy of the algorithm is analyzed.The following improvements are made in the algorithm:Firstly,because there are many splicing operations on features from the backbone Network in the Path aggregation network(PAN)region of the algorithm,and there are common features among the spliced feature graphs,there is a certain degree of feature redundancy.Therefore,Ghost and DSP,two lightweight feature extraction structures,are used to replace the convolutional structures in this region,and a more efficient feature extraction structure is selected.Experiments show that the Ghost method is better than DSP method in lightweight effect,its average precision value is higher than the former 0.41%,reaching 92.79%,the number of parameters is reduced to 78.58% of the original algorithm.Secondly,three different residual attention mechanisms are added on the basis of lightweight,and the optimal residual attention mechanism is selected through experiments.Meanwhile,PAN area is improved and Bi-directional feature pyramid network(Bi-FPN)is added.The weighted path in Bi-FPN enhances the cross-domain communication of features.In the detection head area,a dual-path lightweight feature extraction structure composed of convolution with the size of 1*1 is used to enhance its ability to independently decouple features and extract location information and confidence information independently.After the improvement of the above method,the average precision of the algorithm is increased by 2.17% to 94.96%,and the number of parameters is 85.31% of the original algorithm.After the improvement,the accuracy of the algorithm is further improved,and compared with the original algorithm,it is lighter,that is,requires less hardware storage space,so it is more convenient to deploy on hardware devices. |