| As a dried fruit commonly seen in Northeast China,pinecones have high edible and medicinal value,and the industry has been expanding.Pinecones are knocked down and picked up manually,which has such problems as high work intensity,high environmental risk and high labor cost.The automation of pinecone collection in the forest has become an inevitable requirement to meet production needs.Pinecone identification algorithm is the key to realizing the automation and intelligence of forest pinecone collection,and determines whether the ground collection device can quickly and accurately complete the pinecone pick-up.In this dissertation to meet the recognition needs of forest pinecone collection devices,that is to say,to improve its accuracy and detection speed,we build a lightweight forest pinecone detection model,deploy it to embedded devices,and realize the fast and accurate detection of forest pinecones.The research mainly includes:(1)Establishing forest pinecone dataset.Take photos of pinecones in different states in the forest,and label the target with the labeling tool.To enhance the diversity of the dataset,the quantity of photos is increased through image sharpening,Gaussian blur,color gamut change and Grid Mask.The dataset is used as the training set and testing set of the subsequent pinecone detection model.(2)Building YOLOv4-Tiny Pinecone Detection Model with Fusion Attention Mechanism.The YOLOv4-Tiny model is optimized to solve the problems of the pinecone detection task in forest,such as small size,similar color to the background and large probability of being covered of the target.The feature fusion of the model is optimized by introducing the channel attention mechanism to enhance the extraction of pinecone features and weaken the background features;the loss function of the model is optimized by Focal loss and α-CIOU to enhance the performance of the model to recognize pinecone samples which are hard to recognize or with high Io U.The average recognition accuracy of the pinecone detection model in this dissertation reaches 94.01%,which can meet the needs of pinecone detection in forest.(3)Building a lightweight YOLOv4-Tiny model for pinecone detection.To address the problems of the existing target detection model,that is,large computation and difficulty in deployment of ground collection devices,a lightweight pinecone detection model is built.First,a lightweight enhanced Shuffle Net backbone network is designed to extract pinecone features,with 26×26 detection head reserved for pinecone prediction.In addition,the 3×3 convolution of the detection layer is replaced with a depthwise separable convolution to speed up the detection speed.Finally,the channel width is reduced to 0.75 times of the original to further compress the model size.The lightweight model proposed in this dissertation reduces the parameters by 87.5% compared to the original YOLOv4-Tiny model,with an average detection time of 7.4ms in RTX2060,which effectively simplifies the model while ensuring the detection accuracy.It provides an option for the model deployment to a pinecone collection device with limited computing power.(4)Optimizing embedded deployment of pinecone model based on Tensor RT.To meet the needs of ground collection devices in real scenarios,a low-cost NVIDIA Jetson Nano is selected as the pinecone detection model deployment platform,and Tensor RT is used to merge model branching and low-precision quantization acceleration.The accelerated pinecone detection model achieves 22 FPS in embedded detection,enabling fast detection of pinecones in low computing power devices.In summary,the lightweight pinecone detection model proposed in this dissertation integrates high recognition accuracy and high detection speed so that it can identify pinecone models quickly and accurately in near-color backgrounds;on the other hand,it optimizes the deployment on embedded devices to provide a more accurate and lightweight solution for pinecone picking devices. |