摘 要
随着我国经济水平的快速发展和人口的不断增加,生活垃圾的数量也呈现持续增长的趋势。因此,迫切需要通过科学有效的垃圾管理措施,如垃圾分类、资源回收和可持续处理等,可以最大限度地减少垃圾对环境和健康的不良影响。但在国内许多数城市,将垃圾混装投放的现象依然大量存在,不利于对垃圾进行有效的分类处理。传统的垃圾分类方法通常需要人工干预,但随着垃圾数量和复杂性的增加,这种方法愈发耗时耗力。而利用深度学习算法对垃圾图像进行识别,能够实现自动、高效的分类过程。
本文基于Python技术,搭建了YOLOv5s深度学习模型,并基于该模型研发了微信小程序的垃圾分类应用系统。本项目的主要工作如下:
(1)调研了移动端垃圾分类应用软件动态,并分析其优劣势;分析了深度学习在垃圾分类领域的相关应用,着重研究了YOLO系列的工作原理和YOLOv5s、YOLOv5m、YOLOv5l、YOLOv5x四大模型的优缺点,最终选择了轻量级深度学习模型YOLOv5s。
(2)本文给出了一种基于深度学习的垃圾图像分类模型YOLOv5s。微信小程序端的垃圾图像分类既要考虑模型的精度,也要保证模型的轻量化,即模型的参数量不能过大,因此在模型设计时需兼顾两者。最后,本项目深度学习模型对垃圾分类的准确率达到了98.5%。
(3)最后实现了垃圾分类系统整体的设计和测试。系统采用前后端分离的方式进行设计,主要功能是通过手机拍照实现对生活垃圾的分类识别,其他功能包括相册照片识别、文字知识分享和垃圾知识图例展示等。
关键词:Python;深度学习;垃圾分类;微信小程序
ABSTRACT
With the rapid development of China's economy and the continuous increase of population, the amount of household waste is also showing a continuous growth trend. Therefore, scientific and effective waste management measures, such as Waste sorting, Recycling and sustainable treatment, are urgently needed to minimize the adverse impact of waste on the environment and health. However, in many cities in China, the phenomenon of mixed loading and disposal of garbage still exists in large numbers, which is not conducive to effective classification and treatment of garbage. The traditional Waste sorting method usually requires manual intervention, but with the increase of the quantity and complexity of garbage, this method becomes more time-consuming and labor-intensive. The use of deep learning algorithms for garbage image recognition can achieve an automatic and efficient classification process.
Based on Python technology, this paper builds a YOLOv5s deep learning model, and develops a Waste sorting application system for WeChat applet based on this model. The main tasks of this project are as follows:
(1) Investigated the mobile Waste sorting application software dynamics, and analyzed its advantages and disadvantages; This paper analyzes the relevant application of deep learning in the field of Waste sorting, and focuses on the working principle of YOLO series and the advantages and disadvantages of YOLOv5s, YOLOv5m, YOLOv5l, YOLOv5x, and finally selects the lightweight deep learning model YOLOv5s.
(2) This article presents a deep learning based garbage image classification model YOLOv5s. The garbage image classification on WeChat mini programs should not only consider the accuracy of the model, but also ensure the lightweight of the model, that is, the parameter quantity of the model should not be too large. Therefore, it is necessary to consider both when designing the model. Finally, the accuracy of the project's in-depth learning model for Waste sorting reached 98.5%.
(3) Finally, the overall design and test of the Waste sorting system are realized. The system is designed using a front-end and back-end separation approach, with the main function of classifying and recognizing household waste through mobile phone photography. Other functions include album photo recognition, text knowledge sharing, and garbage knowledge legend display.
Keywords:Python;Deep learning;Waste sorting;WeChat mini program