Forestry seedlings are an important guarantee for forestry construction and development,and an indispensable material basis for forestry production and major project construction.As the scale of afforestation in China continues to expand,the quality and yield of nursery seedlings are becoming more and more demanding.The inspection and acceptance of nurseries is an important step and link in the analysis of the quality and yield of forestry nursery work.However,traditional nursery acceptance is often done directly by nursery managers using manual acceptance of nurseries,which is labour-intensive and time-consuming,so a solution is urgently needed for this situation.With the development of 5G technology,its high bandwidth,low latency and high density access features have led to a change in the cloud computing model to a "cloud-management-end" model,with edge computing as the key terminal technology for the deployment of artificial intelligence algorithms on terminals with limited computing power becoming the key to the key.In this paper,we propose a lightweight algorithm for pine tree sapling detection and counting in nurseries,taking the algorithm for pine tree strain identification in nursery acceptance as an example,which is applicable to the deployment of AI algorithms in embedded terminals.The main work is as follows:(1)To achieve the requirement of deploying the transplant and detecting and counting nursery pine sapling plants at the edge embedded end,this paper adopts two improvement methods based on the YOLOv5 s model with a total of seven options to achieve the lightweight of the model.The other is to replace or design all the Bottleneck structures in the YOLOv5 s model with lighter structures and to conduct experiments on all the improved solutions.The experimental results show that replacing the backbone network with the Mobile Netv3 structure has a better lightweighting effect,and the model computation is significantly reduced from15.9G to 6.3G.(2)In order to reduce the loss of accuracy caused by the lightweighting of the model,and to make the improved model meet the demand of real-time detection at 25frame/s at the edge,the Mobile Netv3-YOLO model is further optimised in this experiment.Firstly,the vector angles of the target and prediction frames were considered on the basis of Io U,the SIo U loss function was adopted as the prediction function,and the associated loss function was redefined so as to make the nursery sapling prediction frame closer to the real frame;meanwhile,the CA coordinate attention mechanism was introduced into the model,and the most suitable addition position was selected through comparative experimental analysis to better improve the model accuracy;finally,a Finally,a pruning-then-distillation scheme is adopted to prune the unimportant channels in the model,and then fine-tune the pruned model to recover its accuracy by using knowledge distillation,which compresses the model size once again while ensuring the model accuracy.The results show that the improved Pruned Dist-Mobile Netv3-YOLO-SC reduces the computational volume to 5.8G with only 0.01 reduction in average accuracy compared to the original YOLOv5 s,reducing it to 36.48% of the original model and providing an algorithm prototype for edge computing endpoint algorithm porting.(3)To determine the practical application effect of the model in the nursery acceptance link,the Pruned Dist-Mobile Netv3-YOLO-SC model proposed in this paper was ported and deployed to a low-cost and computationally limited small embedded development board for speed testing,and the detection speed reached 25.6 frames per second,meeting the requirement of real-time detection for nursery acceptance,while the acceptance accuracy rate was similar to that of The accuracy of acceptance is basically the same as that of traditional manual acceptance,but with great savings in time and labour costs,proving the practical application value of this algorithm. |