Recyclable garbage classification method based on deep learning
Through a deep learning-based method, using the VGG19 model and optimizer, the existing garbage classification methods have solved the problems of high misclassification rate and low efficiency, and efficient and accurate garbage classification is achieved, reducing costs and environmental pressure.
Patent Information
- Application Number
- CN202311547067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2025-05-20
AI Technical Summary
The existing garbage classification methods are disturbed by human subjective factors, and the misclassification rate is high, which cannot meet the large-scale and efficient garbage classification needs, and are costly and have great environmental pressure.
Using a deep learning-based approach, the VGG19 model and ImageNet dataset are used to improve the accuracy of garbage classification recognition through image preprocessing, feature extraction and transfer learning, combined with Lookahead and LazyOptimizer optimizer.
Efficient and accurate garbage classification has been achieved, the misclassification rate has been reduced, the efficiency of garbage disposal has been improved, and environmental and social pressure has been reduced.
Smart Images

Figure CN120020907A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and specifically relates to the application of a recyclable garbage classification method based on deep learning. Background Art
[0002] With the development of society, the problem of garbage disposal has become one of the major problems faced by cities. At present, China vigorously promotes garbage recycling. However, in real life, the public does not fully master the garbage classification method, and the implementation effect of garbage classification is not good. At present, garbage disposal stations need to use manual methods or traditional mechanical classification equipment for secondary garbage classification. Although these methods solve the problem of garbage classification to a certain extent, they are often interfered by human subjective factors, prone to misclassification, and limit the garbage disposal efficiency. Moreover, they cannot meet the needs of large-scale and high-efficiency garbage classification. In addition, manual classification also requires a large amount of human resources, which not only increases the cost of garbage disposal, but also causes pressure on the environment and social sustainability. Traditional mechanical classification equipment also has problems of inaccurate classification and difficulty in adapting to diverse garbage types. Therefore, it is crucial to find an efficient and accurate garbage classification method.
[0003] Deep learning technology has achieved great success in the fields of image recognition, speech recognition, natural language processing, etc. Its powerful pattern recognition and learning capabilities make it an ideal solution to the garbage classification problem. Deep learning algorithms can automatically identify and classify different types of garbage, reducing human interference and errors, and improving the accuracy and efficiency of garbage classification. The research and development of a recyclable garbage classification method based on deep learning will provide an innovative way to solve the problem of urban garbage disposal. It can improve the accuracy of garbage classification, reduce the cost of garbage disposal, relieve the environmental burden, and at the same time help improve the public's awareness and participation in garbage classification. Summary of the Invention
[0004] The purpose of the present invention is to implement a recyclable garbage classification method based on deep learning. The VGG19 model is selected, and the ImageNet dataset is used. After classifying and preprocessing garbage images, the feature extraction of the images is completed. Through network training and transfer learning, the generalization ability of the model itself is strengthened. Then, through the improvement of the optimizer, two optimizers, Lookahead and LazyOptimizer, are combined and applied. Through the complementary advantages of the two, the accuracy of garbage classification recognition is improved.
[0005] The technical solution adopted by the present invention is as follows:
[0006] Step 1: Construct a dataset. Screen the pictures in the ImageNet dataset, select the recyclable garbage pictures, and then divide the dataset to provide support for the training of subsequent steps;
[0007] Step 2: Preprocess the constructed dataset by adopting methods such as image denoising, data augmentation, image segmentation, and feature extraction to achieve the unification of image quality and enhance the valuable features of the images.
[0008] Step 3: Use the VGG19 network model for training, apply the best weights after training for testing, and conduct comparative experiments with other network models.
[0009] Step 4: Combine the Lookahead optimizer and the LazyOptimizer optimizer, and conduct accuracy tests and comparisons with the network model that only uses the LazyOptimize optimizer. Conduct tests separately for five types of recyclable garbage, namely waste paper, waste plastic, waste glass, waste metal, and waste fabric, to verify the application effect of the model. Description of the Drawings
[0010] Figure 1 It is: the VGG19 network model.
[0011] Figure 2 It is: the model training loss process.
[0012] Figure 3 It is: the sample test accuracy.
[0013] Figure 4 It is: the test and comparison of the classification accuracies of different models.
[0014] Figure 5 It is: the comparison of the classification accuracies before and after transfer learning.
[0015] Figure 6 It is: the comparison of the classification accuracies of five types of garbage. Detailed Implementation Manner
[0016] The present invention will be further described below in conjunction with the drawings. The specific methods for implementing the present invention include the following steps:
[0017] Step 1: Construct a dataset
[0018] Reasonably constructing the dataset is the primary step in designing an intelligent garbage classification system. The ImageNet dataset is selected in this invention. Such a dataset covers up to 14 million images and has more than 20,000 image categories. Among various types of garbage, recyclable garbage has the highest recycling value. Recyclable garbage can be divided into five categories: waste paper, waste plastics, waste glass, waste metal, and waste fabrics. After determining the data classification, the dataset needs to be divided. By randomly extracting pictures, 50,000 pictures are divided into three datasets. The training set covers 70% of the picture volume, while the test set and the validation set are 20% and 10% respectively. First, unclear pictures are removed, and then the data is normalized. Then, the training set data with an image size of 227×227, 35,000 test set data, 5,000 validation set data, and 10,000 test set data are obtained. The data is stored in RGB format. Various garbage pictures and their corresponding label files are stored in the same folder in jpg and txt formats respectively, and their serial numbers correspond one by one. The image size, brightness, and angle are different, which can support subsequent model training and thus achieve more accurate garbage recognition.
[0019] Step 2: Data preprocessing
[0020] Since there are differences in the image quality in the dataset, quality unification needs to be carried out through preprocessing. The purpose of preprocessing is to optimize data information, enhance the valuable features of the image, and improve the accuracy of recognition.
[0021] (1) Image denoising
[0022] When preprocessing the image, first, a mean filter is selected for denoising. Through filtering, the image distortion problems caused by the surrounding environment interference and photographing techniques are eliminated. By retaining the detailed features of the image and suppressing the image noise, the image noise is eliminated, and thus the image recognition rate is improved. This is because the useless frequency information contained in different frequency signals during deep learning will affect the final learning result. Therefore, it is necessary to screen out the useless frequencies through filtering. Using a mean filter for denoising can calculate the mean value of the pixels except the center in a certain area, and then use the mean value to replace the center point, effectively eliminating the useless noise, enhancing the smoothness of the image, and having a fast and good noise elimination effect.
[0023] (2) Data augmentation
[0024] When performing deep learning data representation, a large amount of data training is required. By optimizing the image quality and quantity, the learning ability of the model is enhanced to learn the deep features of the data and ensure the accuracy of model recognition. However, during actual training, when the data volume is small or the data distribution is uneven, overfitting may occur during model training. Therefore, data augmentation is needed to solve the overfitting problem. Data augmentation can improve the image clarity, remove the useless information, strengthen the feature differences of similar image categories, and enhance the recognizability of the image by improving the information quality. The contrast of the image can be enhanced by methods such as histogram equalization processing or affine transformation. During the affine transformation process, geometric transformation, color interference or random image erasing processing will be performed on the image to achieve data augmentation.
[0025] Step 3: Model training and testing
[0026] In the training, the VGG19 network is used, and the network structure is as Figure 3 shown. Before model training, model parameters should be reasonably selected. After multiple experimental analyses, the maximum number of single training iterations within a cycle is determined to be 15. During the experiment, after transfer learning, the training speed of the model will increase significantly. When the number of iterations does not exceed 10 times, the loss function shows a significant decrease, while after 10 times, the decrease amplitude of the loss function decreases, as shown in Figure 2 shown. When the number of iterations is different, the image test accuracy is different. When the number of iterations is less than 5 times, the test accuracy shows a gradual increase. When the number of iterations is higher than 5 times, the test accuracy is always in the range of 95% to 100%, as shown in Figure 3 . After model training, common waste paper, waste plastic, waste glass, waste metal and waste fabric in life can all be detected and the recyclable waste can be correctly marked. Further train other network models, retain the best model weights after training iterations, and use the test set to test the model accuracy to compare the classification accuracy of different models, and then determine the generalization ability of the model. In the experiment, three models, VGG19, VGG16 and AlexNet, were compared and analyzed, and the test results of the model classification accuracy are shown in Figure 4 . Through comparison, it is found that the VGG19 model has the highest accuracy, between 94.9 - 95.4%, higher than the accuracies of the VGG16 model and the AlexNet model. It shows that the VGG19 model has good image classification ability and can meet the actual needs. Therefore, the VGG19 model should be selected.
[0027] Step 4: Optimizer test and transfer learning test
[0028] The Lookahead optimizer is a new algorithm that can complete the selection of the search direction by looking at the fast weight sequence of another optimizer. When this optimizer is applied in combination with the Adam optimizer or the SGD optimizer, it can enhance the generalization ability of the optimizer, accelerate the fitting speed, improve the learning efficiency, and enhance the robustness of its own hyperparameters. The new version of the LazyOptimizer optimizer transmits the wrapped Adam optimizer to all Embedding layers, and the accuracy rate can be increased to 92%. During the optimization process of the recyclable waste classification algorithm, it can be combined with Lookahead for application, thereby enhancing the generalization ability of the optimizer and the fitting speed, while strengthening the accuracy and stability of the algorithm. During the optimizer test, the classification accuracy rate of using the LazyOptimizer optimizer alone was obtained and compared with the accuracy rate of combining Lookahead and the LazyOptimizer optimizer. The accuracy rate comparison data can be seen in Figure 5 . Classification tests were carried out for five types of recyclable waste, namely waste paper, waste plastics, waste glass, waste metals, and waste fabrics, and relatively high classification accuracy rates were obtained. The test results of the classification accuracy rates for the five types of waste can be seen in Figure 6 .
[0029] In summary, this paper conducts research on the optimization of the intelligent waste classification algorithm. The VGG19 model is selected, the Softmax classification algorithm is used, and the ImageNet dataset is utilized. After classifying and preprocessing the waste images, the feature extraction of the images is completed. Through network training and transfer learning, the generalization ability of the model itself is strengthened. Then, through optimizer improvement, two optimizers, Lookahead and LazyOptimizer, are combined for application. By complementing each other's advantages, the accuracy of waste classification recognition is improved. Through the waste recognition test experiment, it is verified that this recyclable waste classification algorithm based on deep learning has a relatively high accuracy rate.
Claims
1. A recyclable waste classification method based on deep learning, characterized in that: The following steps are involved: Step 1: Construct a data set, filter the images in the ImageNet data set, select the recyclable garbage images and divide the data set to provide support for the training in the subsequent steps; Step 2: Preprocess the constructed data set by using image denoising, data enhancement, image segmentation and feature extraction methods to achieve uniform image quality and enhance the valuable features of the image; Step 3: Use the VGG19 network model for training, use the best weights after training for testing, and conduct comparative experiments with other network models; Step 4: Combine the Lookahead optimizer and the LazyOptimizer optimizer, and conduct an accuracy test comparison with the network model that only uses the LazyOptimize optimizer. Tests were conducted on five types of recyclable waste: waste paper, waste plastic, waste glass, waste metal, and waste fabric to verify the effectiveness of the model application.