Currently,the problem of garbage pollution in water environments is increasingly severe.While garbage floating on the water surface or piled up on the shore can still be manually cleaned up,garbage sedimented under the water is difficult to remove manually and poses a serious threat to human health and the ecological environment if left for a long time.However,with the emergence of underwater autonomous robots,this problem has been solved.In the process of cleaning up garbage using underwater robots,it is crucial to detect garbage quickly and accurately.However,the complex underwater environment and the limited computing and storage resources of mobile devices commonly used in this context significantly affect the accuracy and speed of detection.Therefore,this paper proposes an efficient and lightweight underwater garbage detection method by improving the YOLOv5 s model based on improving image quality and reducing the impact of degraded underwater images on detection accuracy.Firstly,in response to the impact of low contrast,color deviation,and haze on detection accuracy during underwater imaging,this paper proposes an image fusion-based underwater image processing method to improve image quality.This paper preprocesses the underwater images to obtain Input1 and Input2,simply removing problems such as color distortion,low brightness,and noise in underwater images,then extracting multiple weight maps for the two inputs and normalizing them to prepare for multiscale fusion,and finally restoring the fused image to obtain a clear underwater image.Experimental results have shown that the proposed method produces clearer images with higher visual quality,and the detection accuracy of the processed images is improved compared to that of the original images.Secondly,considering the limited computing and storage capabilities of underwater mobile devices,this paper proposes an improved YOLOv5s-based underwater garbage detection method by designing a lightweight network structure.The backbone network of the YOLOv5 s network is replaced by a Mobile Netv3 network with a Convolutional Block Attention Module(CBAM).Mobile Netv3 significantly reduces the number of network parameters,while the CBAM module can refine feature maps from both the spatial and channel dimensions.Experimental results have shown that the improved network structure reduces the number of parameters and computation by more than half compared to the base network,but there is a slight decrease in detection accuracy and speed.Finally,in order to further reduce network computation and memory costs,this paper proposes a model compression method based on filter pruning.A sparsely trained network model with parameter sparsity is obtained,redundant filters and their corresponding feature maps are removed according to evaluation indicators,and then the model is retrained to restore detection accuracy.Experimental results have shown that the compressed model has improved detection accuracy and speed compared to the improved YOLOv5 s network,and the number of model parameters and computation are significantly reduced.In summary,this paper proposes a method that improves network detection accuracy while reducing the number of parameters and computation,achieving a detection accuracy of 97.5%,reducing the number of parameters and computation by 1/10 and 1/5 of YOLOv5 s,respectively,and achieving a CPU detection speed 2.5 times faster than that of YOLOv5 s.This method can balance network detection accuracy and speed,meet the requirements of limited computing and storage resources of hardware devices,and has important practical significance for cleaning up garbage and improving water environments using underwater robots in the future. |