| Cetaceans as a rare underwater mammal,due to its rich resources in the body,are hunted by a large number of human beings,resulting in cetaceans on the verge of extinction.Since the last century,human beings have paid more and more attention to the protection of cetaceans.The observation and protection of cetaceans require a lot of manpower and material resources,so embedded equipment is usually used instead of human beings to observe and protect cetaceans.At present,the hardware resources of embedded devices are limited,the algorithm model of object detection is large,and the running speed is slow,so the real-time object detection in embedded devices cannot be realized.Therefore,the research on lightweight object detection algorithm for cetaceans has certain research value and practical significance.This paper mainly improved the existing object detection algorithm by lightweight,and ensured the object detection accuracy while maintaining the lightweight network model.The algorithm was deployed to embedded devices to verify the feasibility and effectiveness of the algorithm.The main research work of this paper is as follows:(1)Aiming at the problem of large object detection algorithm model,this paper carries out lightweight design of YOLOv4 object detection algorithm.In this paper,Mobile Netv3 is used as the backbone network and a lightweight backbone network is used to achieve feature extraction.In this paper,the neck and head network adopts DSC structure to improve the lightweight,and the lightweight network structure is used to achieve further feature extraction,so as to realize the lightweight design of the object detection network as a whole.Compared with the YOLOv4 network before optimization,the lightweight optimization method adopted in this paper reduces the reasoning time by 45.28%,the number of model parameters by 87.25%,and the floating point calculation by 89.86%,which proves the effectiveness of the lightweight optimization method adopted in this paper.(2)Aiming at the low detection accuracy of the lightweight network model,this paper optimizes the training process of the lightweight object detection algorithm,so as to improve the detection accuracy of the algorithm.In this paper,the method of optimizing loss function and adding data augmentation is adopted to optimize the network training process,so as to improve the detection accuracy of the model under the condition that the network model remains unchanged.In terms of loss function optimization,SIo U loss function is adopted in this paper.In the training process,the Angle loss,distance loss,shape loss and Io U loss between the predicted box and the real box are taken into account,so as to calculate the loss between the predicted box and the real box more comprehensively.In the aspect of data augmentation,Mosaic algorithm is used for data augmentation to enrich the background of images input in the training process,thus improving the detection accuracy of the algorithm.The optimization method adopted in the training process of this paper improved the detection accuracy of all kinds of targets,m AP increased by 3.83%,m F1 increased by5.62%,proving that the optimization method used in the training process can improve the detection accuracy.(3)In order to verify whether the proposed method can be run on embedded devices,the algorithm is deployed on Raspberry Pi and Jetson embedded devices,and the reasoning time of different deep learning frameworks in different embedded devices is compared.In this paper,the optimized object detection algorithm is verified in embedded devices.The inference time is 676.23 ms in CPU-based Raspberry Pi device by using ONNX model,and 26.76 ms in GPU-based Jetson device by using Tensor RT model.It is proved that the proposed method can be used for cetacean object detection in embedded devices.In this paper,lightweight improvement of YOLOv4 object detection algorithm,lightweight design of network model structure,and optimization of training process are carried out to ensure the accuracy of model detection while reducing the number of model parameters and the time required for reasoning.Finally,the model is transplanted to embedded devices for testing,which verifies that the proposed method can be deployed in embedded devices,and further proves that the proposed method has certain academic value and research significance for cetacean lightweight object detection. |