| With the rapid development of aerial photography technology of unmanned aerial vehicle and unmanned ship,it has become an inevitable trend to replace floating garbage in open channels by manual inspection.However,how to efficiently and accurately detect floating garbage in open channels has become a current research hotspot.Aiming at the problem that floating garbage in open channels is small in size and easily disturbed by factors such as reflection on the water surface and strong light,resulting in missed detection and false detection of floating garbage,a real-time detection method of floating garbage in open channels based on improved YOLOv5 s is proposed.The main work contents are as follows:Aiming at the problem that floating garbage in open channels is small in size and easily disturbed by factors such as reflection on the water surface and strong light,a YOLOv5 s detection method of floating garbage in open channels based on multi-scale feature fusion is proposed.Firstly,the data set is augmented to avoid overfitting.Then,the resolution of network input is increased to make the image have more detailed information and more accurate location information,which is conducive to the extraction of small target feature information.Next,combined with the weighted BiFPN structure,the feature fusion process of YOLOv5 s structure is modified to improve the detection accuracy and speed.Finally,three improved 3D CBAM attention mechanism modules are added to enhance the ability of network information extraction and location,and effectively reduce the rate of missed detection and false detection.The experimental results show that the average accuracy of the improved algorithm reaches 89.9%,but the calculation amount and parameter number of the model increases.Aiming at the problem that the above algorithm increases the parameter number and calculation amount of the model,a YOLOv5 s detection method of floating garbage in open channels based on lightweight network is proposed.Firstly,Ghost module in GhostNet is introduced to carry out lightweight processing on the feature extraction and feature fusion part of the algorithm,which is used to reduce the calculation amount and parameters number of the model,so that the model is more convenient to deploy to mobile devices and embedded devices.Then,the multi-head attention mechanism of Transformer is introduced in the backbone network to solve the problem of incomplete extraction of global feature information caused by lightweight model.Finally,the loss function CIoU of the regression positioning algorithm is replaced by EIoU to reduce the error positioning,and ensure the stability of the model,further improving the detection performance of floating garbage in open channels.The experimental results show that the parameters and calculation amount of the model are reduced by nearly half after the model is lightened,the detection speed is also greatly improved,and the average accuracy reaches 92.4%. |