| By the end of 2022,China’s population has reached 1,411.8 million.The huge amount of household garbage generated will cause serious damage to the natural environment,human health and social economy.Classification is a necessary measure for efficient disposal of household garbage.However,since garbage classification has never been mandatory in China until 2020,our residents have insufficient knowledge of separation and a high rate of classification errors.On the other hand,with the popularity of smartphones and the increasing maturity of machine learning technology,it has become possible to use object detection technology on wearable devices for intelligent classification of household garbage.To address this situation,this thesis applies the one-stage object detection algorithm YOLOv5 to garbage classification,improves the algorithm to make it more suitable for garbage detection,and deploys the resulting model to a mini program.This thesis tries to solve the current problem of difficult garbage classification through a simple and efficient computer vision-based garbage classification framework implemented.The specific work completed in this thesis is as follows:(1)Improving the network architecture of YOLOv5s-5.0.Since most of the garbage detection objects in daily photos are small in scale,a Swin-transformer prediction head is firstly added to mitigate the impact of drastic changes in target scale.This thesis also replaces the original Si LU activation function with the more powerful H-Swish to enhance the expressiveness of the model and avoid model overfitting,then we eliminates the anchor-based paradigm to save the time and memory resources wasted on calculating anchor points.Finally,we replaces the original CIo U_Loss with the SIo U_Loss regression loss function to improve the predicting accuracy of the the bounding box regression.(2)Constructing a rubbish dataset in a format adapted to YOLOv5.Given that the existing datasets are not comprehensive enough,the sample distribution is uneven and the frame format is not compatible with YOLOv5,this thesis firstly fuses three public datasets,namely PASCAL VOC2007,MS COCO2017 and TT100 K,from which 51 types of subdivided rubbish images are manually filtered.Finally,the resulting 21,844 images were either annotated or transformed to adapt to the format requirements YOLOv5.(3)Experimentation of the garbage detection model trained by improved YOLOv5s-5.0.The experiments yielded 85.9% for m AP@0.5 and 70.2% for m AP@0.5:0.95,with a precision of 91.1%,and an improvement in the detection speed of the model.(4)Designing and developing a mini program called Garbage Inspection Committee with the trained model.Users can take a photo or upload an album image in the mini program,and the image will be annotated and presented in the form of a pop-up notification? in addition,the mini program provides functions such as quiz on related knowledge,browsing classification criteria and related news.The TOP1 accuracy for the garbage image classification task of the mini program is 94.5%,which can achieve accurate localization and classification of household garbage. |