| The accumulation of floating objects in the water area will cause a significant increase in the nitrogen and phosphorus content and the concentration of pollutants in the water covered by them,which will lead to eutrophication of the water body and pose a serious threat to the water ecological environment in China.Real-time monitoring of water conditions is a key link in the prevention and control of floating object pollution.How to obtain key information in time from massive monitoring data and accurately identify and locate floating objects is an urgent problem to be solved in the realization of intelligent river and lake management.In view of the key problems in the detection of floating objects in the water area monitoring scenario,this paper proposes a lightweight floating object detection method based on YOLOv5,which solves the problem of floating object detection under water scenes,relying on the water conservancy monitoring platform of Shandong Province,and using water video integration resources.The main research contents and results are as follows:(1)The construction and pretreatment of the floating object data set.In view of the problems of small scale and poor quality of the existing floating object data sets,the floating object data in the backbone rivers and key lakes and reservoirs in Shandong Province were collected.Aiming at the problems of small scale floating objects in the sample image,such as the lack of small scale floating objects,the single detection scene,the partial occlusion of floating objects and the uneven illumination of the image,the corresponding pretreatment scheme is proposed:Firstly,the Mosaic algorithm is used to expand the scale of small-scale floating object samples and enrich the detection background;Secondly,Cutout algorithm is introduced to simulate the detection scene of local occlusion to enhance the feature extraction ability of the detection model for occluded objects;Furthermore,the brightness equalization algorithm is used to compensate the brightness of the sample image to ensure that the overall background brightness of the sample is consistent.LabelImg software is used to label floating objects,and clustering algorithm is used for statistics and evaluation of the data set.The results show that the data set scale is effectively expanded after data augmentation;The sample categories tend to be balanced;The dimension boxes are mostly small and medium-sized and evenly distributed.(2)Improved YOLOv5 lightweight floating object detection algorithm.This paper aims to improve YOLOv5s algorithm on the premise of ensuring the detection detection,with the main purpose of improving the detection speed and realizing the model lightweight.The improvement includes three aspects:network structure reconstruction,loss function optimization and attention mechanism integration:building a lightweight floating object detection model Slim-YOLOv5 by introducing Depth Separated Convolution,Lightweight Convolution Module(Shuffle Unit)and Bidirectional Feature Pyramid Network;Focal Loss function is used in this paper to strengthen the network’s mining of difficult sample information and alleviate the sample imbalance problem in the detection task.The floating object detection algorithm is integrated with attention mechanism to strengthen the algorithm’s attention to the key information in the floating object area.In order to verify the effectiveness of the algorithm proposed in this paper,a comparative test is carried out on the basis of the floating object data set.The results show that the mean average precision of the improved algorithm(IoU=0.5)is increased by 9.4%;The detection speed reaches 37.5 frames per second under NVIDIA Quadro P2200 graphics card;The model volume is 8.3MB,which is only 60.5%of the original algorithm.In general,the improved algorithm can effectively balance the detection accuracy,speed and model complexity.(3)Deployment of algorithm.In order to verify the performance of the detection algorithm proposed in this paper on mobile or embedded resource-constrained platforms,Jetson Nano development board is selected to deploy and test the algorithm.The TensorRT engine is used to adapt the acceleration requirements,and the detection speed after acceleration is about 1.78 times that before acceleration;DeepStream is selected to process streaming media files,and the detection speed is maintained at about 60 frames per second;In terms of detection accuracy,the lightweight detection algorithm deployed in the edge equipment has a slight of floating objects missing detection.In general,the lightweight floating object detection algorithm based on the edge device Jetson Nano has achieved ideal detection results in application.Finally,in order to promote the implementation of the algorithm and empower the water conservancy business,a floating object detection system is designed based on the actual task requirements.Through the research on the detection of lightweight floating objects under water monitoring,this paper provides detailed data base map for the intelligent management of rivers and lakes,and provides technical support for the long-term supervision of water areas.Deeply integrating the new generation of information technology and water conservancy business is the only way to realize the construction of intelligent water conservancy. |