Lightweight Garbage Detection Algorithm Based on Improved YOLOv5s
Zhenqi Xiao, Guangxiang Yang, Xu Wang · 2023
Garbage classification not only helps to avoid resource wastage and environmental pollution but also reduces the cost of waste management, which is of significant importance for environmental protection. In order to promote the development of garbage classification, a high-precision garbage detection model that can be deployed on embedded devices is highly necessary. However, there are several problems with garbage detection models currently deployed on embedded devices, such as large algorithm parameters, large model sizes, and high computational complexity. To address these issues, a lightweight detection algorithm, Distilled_YOLOv5s_ABCS, was proposed by combining YOLOv5s and MobileNetV3. To compensate for the detection accuracy loss caused by the lightweight design, we use the coordinate attention module to replace the squeeze-and-excitation module in MobileNetV3 and add it to the head network. In addition, the integrated module of self-attention and convolution and spatial pyramid pooling fast module is added to the backbone network to improve feature extraction capabilities. The neck layer uses a weighted bidirectional feature pyramid network to enhance feature fusion. Finally, knowledge distillation is used to improve detection accuracy further. Experimental results show that compared to the original YOLOv5s algorithm, the Distilled_YOLOv5s_ABCS algorithm reduces the algorithm parameter quantity, computational complexity, and model size by 50.8%, 62.4%, and 50%, respectively, while slightly decreasing mean accuracy precision. Additionally, the image processing speed on the CPU increased by 21.3%. The mAP value of the Distilled_YOLOv5s_ABCS algorithm is 89.6%, which meets the requirements for deployment on embedded devices.