Next Article in Journal
Mechanical Properties and Drying Shrinkage of Alkali-Activated Coal Gangue Concrete
Previous Article in Journal
Masonry in the Context of Sustainable Buildings: A Review of the Brick Role in Architecture
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Garbage Classification Method Based on a Small Convolution Neural Network

Electronics & Information School, Yangtze University, Jingzhou 434023, China
*
Author to whom correspondence should be addressed.
Sustainability 2022, 14(22), 14735; https://doi.org/10.3390/su142214735
Submission received: 6 October 2022 / Revised: 31 October 2022 / Accepted: 7 November 2022 / Published: 9 November 2022
(This article belongs to the Section Waste and Recycling)

Abstract

:
To improve the efficiency of social garbage classification, a garbage classification method based on a small convolutional neural network (CNN) is proposed in this paper. For low accuracy caused by light and shadow interference, an adaptive image-brightening algorithm is developed to average the brightness of the background in the image preprocessing stage, and a threshold replacement method is used to reduce shadow noise. Then, the Canny operator is used to assist in cropping the blank background in the image. For debugging low efficiency caused by the complex network, the neural network is optimized based on the MLH-CNN model to make its results simpler and equally efficient. Experimental results show the preprocessing in this study can improve the accuracy of model garbage classification. The CNN model in this study can achieve an accuracy of 96.77% on the self-built dataset and 93.72% on the TrashNet dataset, which is higher than the 92.6% accuracy of the MLC-CNN model. The network optimizer can also enhance the classification ability of the network model using the Adamax optimization algorithm based on Adam variants. In this paper, the network model derived from training is combined with the host computer software to design a garbage detection page so the model has a wider range of uses, which has a good effect on promoting the development of social environmental protection and improving residents’ awareness of environmental protection.

1. Introduction

With rapid population growth and rapid economic development, the world’s resource consumption and waste generation are rapidly increasing. Global solid garbage generation was approximately 1.3 BT/year. By 2030, garbage generation is predicted to increase further to a huge 2.2 BT/year [1]. As the world’s most populous country, China produces approximately 400 million tons of domestic garbage every year, and the annual growth rate of garbage production is 8% [2,3]. Much of the garbage generated in cities is directly landfilled and incinerated without being treated, causing the urban ecological environment to fall into a vicious circle of pollution and affecting the daily life of residents [3,4]. Solid garbage is characterized by its diverse nature [1]; thus, it is necessary to effectively classify it, which is also conducive to the sustainable development between the economy and the environment [5].
To prevent the continuous damage to the environment caused by garbage, on 30 March 2017, the General Office of the State Council forwarded the “Implementation Plan for Domestic Waste Classification System”, showing China’s compulsory attitude and determination to environmental protection and garbage classification. The implementation of garbage classification in China has certain limitations and difficulties. The low efficiency of traditional machine and manual garbage classification, the lack of residents’ awareness of garbage classification, and the complex classification standard are all important reasons [3,6]. With the rapid development of modern artificial intelligence technology and the substantial improvement of computer computing power, many human lifestyles have been promoted and developed, such as image recognition, e-commerce, and social networking. These modern smart applications increasingly use a class of techniques called deep learning [7]. CNNs are deep learning techniques that can be used to process data in the form of multiple arrays [7], such as a color image consisting of three two-dimensional arrays containing pixel intensities in three color channels.
In this paper, a CNN is used to build a garbage classification network, and the model is derived after training the CNN so the model can be used to effectively detect domestic garbage. The combination of the network model and the graphic page of the upper computer can form a garbage detection system, which can then be deployed to the front-end processing of urban garbage cans and the back-end industrial classification processing, which greatly reduces the cost of garbage classification and enhances the accuracy of garbage classification, thus effectively promoting the development of environmental protection.

2. Development and Analysis

Traditional machine-learning techniques are limited in the processing of natural data in raw form because careful engineering and extensive domain expertise are required to design a suitable feature extractor for the data [7] (e.g., image brightness values). The designed algorithm cannot efficiently update with the change in data. Deep learning is a representation-learning method with multiple levels that is suitable for learning tasks with high-dimensional data. With the deepening of the network, the receptive field of deep learning will become increasingly larger, that is, the network can learn more abundant image features in the image. As one of the representative algorithms of deep learning, CNNs are suitable for processing data in the form of multiple arrays (such as three-dimensional image data) and are widely used in computer vision and image recognition [7,8]. In the case of multiple classifications and many samples, CNN will have better results than traditional machine classification algorithms (such as SVM). Costa et al. divided garbage images into four categories based on the TrashNet dataset and obtained the accuracy of the K-nearest neighbor (KNN) [9], support vector machine (SVM), and random forest (RF) algorithms through experiments, which were 88%, 80%, and 85%, respectively [10]. Shi et al. designed a simple and effective MLH-CNN model and proved the superiority of the model for garbage classification. The model can achieve 92.6% garbage image classification accuracy [11].
Using the advantages that deep learning can continuously deepen the neural network, the neural network can be controlled to learn richer feature information in the image. The following introduces some new application methods of neural networks in the field of garbage classification. Wang et al. proposed a solution that combines deep learning CNN with IoT devices [12]. The main design of the scheme is that the garbage container can classify the garbage, and at the same time, the sensor is used to monitor the total amount of garbage generated in a certain area and the operational status of any garbage container. The data obtained by the monitoring are uploaded to the urban waste management center to realize the intelligent management of urban waste. Luo et al. used cloud-computing power to build an edge cloud orchestration (DEC) system based on a CNN network [13]. The edge server collects and preprocesses images and periodically sends new image samples to the cloud server. In addition, the classification network of the cloud server can continuously learn and update the cloud model, thereby improving its recognition ability. Bai et al. designed a new type of grass garbage collection robot based on CNN and computer vision technology [14], which mainly applies deep learning for the semantic segmentation of ground images in robot vision and then locates the garbage. After moving to the location of the garbage, the network model is used to classify the garbage, and then the robot arm moves to pick up the garbage. Using deep learning CNN for garbage classification is a feasible solution, and its application fields and prospects are very broad, which will become part of future environmental protection and intelligent life.
There are still some problems with the use of deep learning for garbage classification. The first problem is that due to the different classification standards for different countries and regions, the number of public datasets is small, and the image quality in the datasets varies. For example, the input image dataset for deep learning to train a network by Sidharth et al. consists of only 2077 image samples of four categories [15]. The second problem is that from the actual application effect of the current garbage classification algorithm, some algorithms or CNN neural network applications do not give very clear actual test results, and the robustness and generalization performance of the model cannot be well verified. For example, Gupta et al. compared the training of several well-known deep-learning neural networks [16], such as ResNet and VGG-16. They only observed the training set and validation set in network training and did not conduct actual testing and evaluation of the model; hence, they could not accurately evaluate the actual application effect of the network model. The third problem is that the commonly used convolutional neural networks (such as VGG-16, Inception V3, ResNet) are relatively complex. When the number of training dataset image samples is large or the image input size is large, the effect of debugging parameters is not ideal [11].
Aiming at the low quality of existing datasets, high-quality images with clean backgrounds and less noise are collected and constructed as a custom dataset for real garbage classification testing. Data augmentation techniques are also used to solve the problem of low number of images in the datasets. To improve the accuracy of garbage classification, an image optimization method is proposed in this paper, which mainly includes brightening and denoising the image using an adaptive threshold brightening algorithm and using the Canny operator to crop the blank background in the image. For debugging low efficiency caused by the complex network, a small CNN based on the MLH-CNN [11] was designed and continued to be optimized to make it simple and efficient. For model training, different optimization algorithms are selected to compare the training and learning processes, and then, an optimal optimizer is selected, and the parameters are adjusted to optimize the classification effect of the model. The generated network model is not only tested on the test set but also tested on real garbage to verify the generalization ability of the model.

3. Dataset Analysis and Construction

Classifiers and datasets are the two basic inputs to machine learning [17]. After the garbage classification image dataset is trained by CNN, the role of the image dataset is crucial if the model generated by the network has excellent test results. Preparing a high-quality and correctly classified dataset is a prerequisite for our deep learning [17].

3.1. TrashNet Dataset

The TrashNet dataset [18] is a public dataset in the field of garbage classification made by Yang et al. of Stanford University in 2016 by placing objects in a clean background. The dataset has six categories of image data, namely, glass, paper, cardboard, plastic, metal, and trash, with a total of 2527 image data samples. The TrashNet dataset has been widely used in the field of deep-learning garbage classification since its publication to evaluate the classification effect of the designed neural network after training. The literature [15,16,19,20] used this dataset to design garbage classification. By observing image samples of the TrashNet dataset, it is found that the background of most of the images is relatively clean, but there is still the problem of inaccurate selection of individual image samples. For example, the classification object of the image is too small or too large and the classification of the classified garbage is wrong. Another problem with the dataset is that the light of some images is too strong, obscuring the characteristics of the object itself so the light becomes the noise in our network training using the dataset images. Part of the image with the above problem is shown in Figure 1. These problems will reduce the accuracy of the network model for garbage classification, and a custom dataset was constructed to train a CNN to generate a model that detects actual classification performance.

3.2. Custom Dataset

To realize that the camera can accurately identify garbage objects based on the construction method of clean background of the TrashNet dataset [18], custom datasets can be built to train the network. The method is to first extract high-quality pictures of the categories required for the experiment in the TrashNet dataset. These pictures are characterized by clear objects, suitable size, less noise, and mainly clean white backgrounds. Then, based on the dataset, high-quality images are added by means of a web crawler or image website search. An image dataset Trash-7 with white as the main background is constructed, which contains a total of 1410 image samples. The types of garbage are some of the common domestic garbage in modern society. Representative image samples of the Trash-7 dataset are shown in Figure 2, which are divided into seven categories, including cans, face masks, glass, leftovers, newspapers, ointment, and plastic bottles.

4. Design Process

The garbage classification design process introduced in this paper can be divided into two parts, as shown in Figure 3. The left half of the dashed box represents the image data preprocessing, and the right half of the dashed box represents the process of building a CNN for network training. Image preprocessing mainly includes image brightening, threshold replacement, image cropping, and data augmentation. CNN designs mainly include building, compiling, training, and testing a CNN.

4.1. Image Preprocessing

The dataset image is a RGB three-channel 256-level brightness value image; thus, the principle of image threshold brightening is the linear increase of three-channel brightness value and threshold judgment. The threshold is set to 255 for evaluation, and the brightness value above the threshold becomes 255; that is, the pixel becomes the maximum brightness value, resulting in a large range of background whitening in the image. A visual schematic diagram of the brightening method is shown in Figure 4. Ideally, most of the background pixels would be lightened to 255.
The automatic image brightening algorithm designed in this paper is based on the image threshold brightening principle, which can automatically set the slope and intercept of the linear increase function according to different images to achieve the appropriate brightening effect of image adaptation. The first step is to select some background points in the image. In this paper, two methods are adopted to collect background points, namely the selection method of the diagonal cross line of the image and the selection method of the center cross line. The visual display is shown in Figure 5. The purpose of adopting two methods is to resist the interference of background noise and improve the fault tolerance of image brightening. Considering the efficiency of the program for image processing, the number of pixels to be collected on each row is set to 10, and the collection interval is 1/50 of the image width. The program is set to start the acquisition from the edge of the image to the center point and collect five pixels.
To exclude the influence of light, shadow, or sundry area in the figure on the calculated background brightness value, it is necessary to set a threshold for the three-channel brightness value of the collected pixel points for judgment. If the brightness value is lower than the threshold, it indicates that the area of garbage or shadow may be collected. At this time, the computer program abandons the action of reading the brightness value of the pixel points and continues to collect at intervals along the center direction until the required number of pixel points are collected. Based on the dataset in this paper, the judgment threshold is set to 100.
The second step is to calculate the average brightness value of the two acquisition methods by the obtained three-channel brightness value of the pixel point and then use the ratio of 255 to the average brightness value to obtain the slope. The general equation for calculating the slope of a linear amplification function is as follows:
K = 255 ( n i + 1 ) i = 1 n ( i B + i R + i G ) / 3
The equation based on the method and quantity of pixels collected in this paper is as follows:
K = 255 × 20 1 20 ( i B + i R + i G ) / 3
where n is the total number of selected background pixels; i represents the number of available background pixels; iB represents the B channel brightness value of the ith pixel in the image; iG represents the G channel brightness value of the ith pixel in the image; iR represents the R channel brightness value of the ith pixel in the image.
The third step is to calculate the intercept with the slope obtained by two methods of collecting background points. The slopes, K1 and K2, calculated by the two methods are compared, and the intercept is calculated according to the following equation:
K   f = K m i n = m i n ( K 1 , K 2 )
K m a x = m a x ( K 1 , K 2 )
b = 255 510 K m i n + K m a x K m i n  
The minimum value is taken as the slope of the linear magnification to reduce the brightness magnification of the image, prevent the brightness distortion of the original image, and retain the characteristics of the original image as much as possible. By setting the threshold interval to replace the remaining light or shadow and other noise brightness values in the image, the replacement RGB brightness values are all 255, which is consistent with the brightened background to achieve the effect of denoising. An example of the image processing process is shown in Figure 6. Then, the Canny operator can be selected to extract the edge features of the image to crop the image and further highlight the image features of the classification object.
Considering that the collected sample data are small and the distribution of objects of the image is single, the model saved after CNN training cannot have good generalization ability; hence, the data augmentation technology is used to augment the data. The augmentation method performs a rotation transformation, translation transformation, flip transformation, or enlargement transformation with random probability and angle on each image of the dataset [19]. Because the state of objects in front of the camera is diverse, various image transformations are used to simulate various situations of the distribution of real objects to enhance the generalization ability of the neural network [20]. The number of samples after the self-built image dataset is enhanced is 5640. The number of samples after the TrashNet image dataset is enhanced is 10,108.

4.2. CNN Design

The small CNN in this study is developed based on MLH-CNN, and its network structure is shown in Figure 7. The developed small CNN includes six convolutional layers and three fully connected layers. The size of the convolution kernel used in the convolution layer is 3 × 3. The stride is 1, and the edge is 0 padding. Each convolutional layer also uses the ReLU activation function to make the network nonlinear, which more effectively avoids the problem of gradient disappearance and improves network sparsity, improves the training speed and efficiency of the neural networks, and alleviates overfitting problems. After the two-layer convolution, a pooling layer with a pooling kernel of 2 × 2 is added. The pooling method is maximum pooling, which reduces the number of parameters of the network and expands the receptive field of the network. A dropout layer is added to the full connection process to temporarily stop the work of half of the neurons in the network, ignoring some fine local features in the image, thereby weakening the overfitting problem of the network and improving the generalization ability of the model [21,22]. The last fully connected layer of the network uses the softmax activation function to map the output of the network to the probability values of seven categories. After the brightening value matrix of the three-dimensional image is passed through the CNN, the probability distribution vector of the category can be obtained, and the position index with the largest vector value is used to achieve the effect of classification.
After the network is built, the selection of network compilation parameters is also very important. Configuring the network compilation parameters allows us to visualize the training process of the network, which is convenient for network structure analysis and parameter adjustment to optimize network performance. The parameters that need to be configured are mainly the optimizer, loss functions, and evaluation metrics. Sparse categorical cross entropy is used in this study as a loss function in the network, which is a commonly used loss function in multicategory networks and can reflect subtle changes in multicategory CNN training. The accuracy is used in this study as the final metric to evaluate the network training performance because the goal of the classification network is to increase the ratio of the number of correctly predicted samples to the total number of samples. The optimizer is an optimization algorithm used to train the network iterative parameters many times. The purpose is to continuously improve the performance of the network, that is, to improve the accuracy on the validation set and test set. It is very important to choose the optimization algorithm. The commonly used optimization algorithms are SGD, Adam, Adagrad, and so on. The most suitable optimizer will be chosen after many experiments. This experimental process and the network training and testing process will be described in detail in the next section. Two image datasets were tested in the study.

5. Experimental and Results

5.1. Optimizer Comparison

CNN training needs to continuously update the weight and bias of the network to achieve better learning effects. The optimization algorithm in the training process is very important. The commonly used optimization network algorithms include the gradient descent algorithm represented by SGD [23], the automatic adjustment learning rate algorithm represented by Adagrad [24], and the adaptive learning rate adjustment algorithm based on first-order and second-order moments represented by Adam Wait [25]. In this study, optimizer comparison experiments are first conducted on the public garbage dataset TrashNet and the custom dataset Trash-7 to test the optimization-learning effects of different network training optimization algorithms on the two image datasets. From this, the most suitable optimization algorithm is found to further adjust the parameters to improve the model ability. The experiment needs to unify the sample parameters of the network input and set the input shape of the image dataset to 64 × 64. In this study, the entire dataset was divided into a test set and a training set, and the number of images in the test set accounted for 20% of the total number of images in the entire dataset. The training set was divided into a learning set and a validation set, and the number of images in the validation set accounted for 25% of the number of images in the training set. The number of samples in the test set is the same as the number of samples in the validation set. The experiment first uses five commonly used network optimizers for network training to compare the accuracy changes of different optimizers under the same parameter conditions. This accuracy is the result of testing on image data on the validation set. The parameters are set as follows:
Optimizer learning rate: 0.001.
The number of iterations of network training: 300.
Batch size for network training: 32.
Figure 8 shows the change in the classification accuracy of the validation set during the training iteration of the preprocessed Trash-7 dataset, and Figure 9 shows the change in the classification accuracy of the validation set during the training iteration of the preprocessed TrashNet dataset.
The Adamax optimization algorithm is a variant of the Adam algorithm, and the network weight update rule is extended from the L2 norm based to the Lp (p→∞) norm [25]. For the Trash-7 and TrashNet datasets, it can be seen from the training process in Figure 7 and Figure 8 that the Adamax optimization algorithm converges faster and achieves the highest accuracy, and the overall effect is the best. The accuracy rate of the Adadelta optimization algorithm iteratively increases too slowly, and the highest accuracy achieved in the test after continuing to increase the training rounds is not as good as Adam; thus, the Adadelta optimization algorithm has poor performance on the experimental dataset. It can also be seen from the figure that the training of the SGD optimizer fluctuates greatly. This is because the process of stochastic gradient descent updates the network. There are some erroneous data in the TrashNet dataset, and the dropout layer makes some neurons randomly inactive influences. The convergence speed, stability, and final arrival accuracy of the training process of different optimizers on the two datasets are comprehensively ranked and compared in this study, as shown in Table 1 below.
After comprehensively comparing the convergence speed, stability, classification accuracy, and diversity of the algorithms from Table 1, three optimizers (Adamax, SGD, Adagrad) were selected for further experiments to test classification consistency effects of the two dataset models by image optimization. The model evaluation standard results obtained by fine-tuning the network parameters and training parameters are shown in Table 2. The accuracy and Kappa coefficient are used in the table to evaluate the ability of the network model after CNN training. The Kappa coefficient is an evaluation standard for measuring the classification effect based on the classification confusion matrix [26,27]. Due to the imbalance in the number of samples in each category in the dataset, the recall number of small sample classes cannot have a greater impact on the accuracy of the entire dataset. The Kappa coefficient can increase the penalty of the change of small and small sample categories on the consistency test. That is, it can judge the classification effect of the model more comprehensively. The Kappa coefficient equation is as follows:
K = ( P o P e ) / ( 1 P e )
Po represents the accuracy of classification, and Pe represents the sum of the product of the number of real samples and the number of predicted samples for each category in the confusion matrix divided by the square of the total number of samples. Assuming that the number of categories in the dataset is m, the number of samples is n, Ai is the number of real samples of the i-th class, and Bi is the number of predicted samples of the i-th class, and Pe is represented by the following equation:
P e = i m A i × B i n 2
Table 2 shows that for the custom Trash-7 dataset, the Adamax optimizer achieves the best effect, and the classification and evaluation effect of the test set after image optimization preprocessing can reach an accuracy of 96.77%. For the TrashNet dataset, the same Adamax optimizer achieves the best effect, and the classification effect of the test set after image optimization preprocessing can reach 93.72% accuracy. Compared with the test results of the MLH-CNN model, the accuracy of this study after using the Adam optimization algorithm is 92.6%, which is higher than its 90.2%, and the accuracy after using the SGD optimization algorithm is 91.3%, which is higher than its 89.7%. The optimized small CNN structure is simpler than the MLH-CNN model network results, and the model classification accuracy can also be higher than the MLH-CNN model’s highest accuracy of 92.6%.
By comparing the classification results of the three optimizers, it can be concluded that the set of image optimization preprocessing methods proposed in this paper can effectively enhance the classification effect of the CNN model constructed by the garbage classification dataset. Using the Adamax optimizer to optimize the garbage classification effect of the network can achieve the best results.

5.2. Reality Test

The test set images in the above experiments are part of the data segmented from the image dataset, and the image data are subject to the distribution of the image training set data; thus, the test effect is better. To more accurately test the generalization ability of the network model produced after training on the constructed dataset, different types of real garbage objects and garbage images from the Internet were collected and made as a garbage image dataset. The real garbage objects were placed in a clean background and captured by the camera to become garbage images. This dataset is randomly altered by data augmentation to form a test set of images containing 700 samples, and each category contains 100 different image samples. Experimental tests show that the time for preprocessing one image is approximately 1.6 s. The CNN model in this paper takes approximately 0.22 s to perform a classification task on an image and approximately 2.37 s for an array of 1000 image data.
Using the Adamax optimizer to train the optimal network model without preprocessing for the classification test, the accuracy rate is 86.14%. After image optimization preprocessing, the network model trained by preprocessing is used for the classification test, and the accuracy rate can reach 94%. The confusion matrix of the conversion of prediction results is shown in Figure 10 below. The test results show that the preprocessing method in this paper improves the accuracy of garbage classification in actual garbage classification; the constructed CNN model has strong generalization ability and can meet the needs of certain practical applications. It can also be seen from the confusion matrix in this study that plastic bottles and glass are prone to misjudgment due to the similarity in shape and color characteristics, which requires continued research on image feature extraction in subsequent research to improve the feature extraction level of images. The discrimination of different classes of objects should also be enhanced during the construction of the dataset to reduce the feature similarity between objects.

5.3. Software Design

A garbage detection host computer software in the Python language environment is designed in this study, and the page is shown in Figure 11. Figure 11a–g show the software detection results of seven different kinds of junk image samples. The software has three detection modes, which can meet the needs of various detection situations and file formats, namely, image garbage detection, video garbage detection, and real-time camera garbage detection. The judgment result display area can display the type of garbage in the image and the corresponding reliability. The parameter display area is used to display the image size and data type of the image data. The software can also select the model path to update the network model used in the detection system. When using video and camera detection modes, model detection uses 20 frames of images to detect once to prevent incorrect judgments caused by dynamic changes in objects. The developed host computer software can make it easier for the trained model to deploy and detect and play a certain role in practical applications. After secondary development, the software can be deployed on the industrial assembly line of garbage sorting for monitoring or assisting garbage sorting; it can also be deployed on a Raspberry Pi equipped with a display screen and a camera to build an IoT smart sorting trash can, which has good practical value.

6. Conclusions

A comprehensive design method for garbage classification based on a small CNN is introduced in this paper and verifies that the image optimization method in this paper plays a role in improving the accuracy of the network model through the comparison experiments of different optimization algorithms. The CNN model takes approximately 2.37 s to process an array of 1000 image data, and the processing efficiency is relatively good. Experimental results show that the Adamax optimization algorithm works best on the network constructed by the two datasets, and the comprehensive test can achieve an accuracy of 96.77% and a kappa coefficient of 96% in the custom Trash-7 dataset. It can achieve 93.72% accuracy and 92.31% kappa coefficient on the TrashNet dataset, which provides a certain reference for further research on garbage classification in the future. The trained network model combined with the host computer software or Raspberry Pi can be used in a wide range of practical applications, such as intelligent garbage classification containers, garbage classification big data, or intelligent garbage classification robots, and so on. It has practical significance for improving the level of social environmental protection and enhancing residents’ awareness of classification. More garbage samples can be continuously experimented and optimized according to the method of this research so the neural network of deep learning can play a wider role.

Author Contributions

Conceptualization, Z.Y. and Z.X.; methodology, Z.Y.; software, Z.Y.; vali-dation, G.Y.; formal analysis, Z.X.; investigation, Z.X. and G.Y.; resources, Y.L.; data curation, Y.L.; writing—original draft preparation, Z.Y.; writing—review and editing, Z.X.; visualization, G.Y.; supervision, Z.X.; project administration, Z.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The TrashNet dataset can be obtained from the link (https://github.com/garythung/trashnet, accessed on 1 June 2022). The Trash-7 dataset for experiments in this study can be obtained by contacting the corresponding author.

Acknowledgments

We thank Mindy Yang and Gary Thung for the open-source garbage classification image dataset, which is the basis of our experimental research.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Al-Dailami, A.; Ahmad, I.; Kamyab, H.; Abdullah, N.; Koji, I.; Ashokkumar, V.; Zabara, B. Sustainable solid waste management in Yemen: Environmental, social aspects, and challenges. Biomass Convers. Biorefinery 2022, 1–27. [Google Scholar] [CrossRef]
  2. Tong, Y.; Liu, J.; Liu, S. China is implementing “Garbage Classification” action. Environ. Pollut. 2020, 259, 113707. [Google Scholar] [CrossRef]
  3. Kuang, Y.; Lin, B. Public participation and city sustainability: Evidence from Urban Garbage Classification in China. Sustain. Cities Soc. 2021, 67, 102741. [Google Scholar] [CrossRef]
  4. Zhao, Y.; Huang, H.; Li, Z.; Yiwang, H.; Lu, M. Intelligent garbage classification system based on improve MobileNetV3-Large. Connect. Sci. 2022, 34, 1299–1321. [Google Scholar] [CrossRef]
  5. Soni, A.; Das, P.K.; Hashmi, A.W.; Yusuf, M.; Kamyab, H.; Chelliapan, S. Challenges and opportunities of utilizing municipal solid waste as alternative building materials for sustainable development goals: A review. Sustain. Chem. Pharm. 2022, 27, 100706. [Google Scholar] [CrossRef]
  6. Fan, Z.; Meng, J. Classification and treatment of urban domestic garbage in China. 2020 IOP Conf. Ser. Earth Environ. Sci. 2020, 514, 032001. [Google Scholar] [CrossRef]
  7. LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
  8. Cai, X.; Shuang, F.; Sun, X.; Duan, Y.; Cheng, G. Towards Lightweight Neural Networks for Garbage Object Detection. Sensors 2022, 22, 7455. [Google Scholar] [CrossRef]
  9. Abeywickrama, T.; Cheema, M.A.; Taniar, D. K-Nearest neighbors on road networks: A journey in experimentation and in-memory implementation. Proc. VLDB Endow 2016, 9, 492–503. [Google Scholar] [CrossRef]
  10. Costa, B.S.; Bernardes, A.C.; Pereira, J.V.; Zampa, V.H.; Pereira, V.A.; Matos, G.F.; Silva, A.F. Artificial intelligence in automated sorting in trash recycling. In Proceedings of the Anais do XV Encontro Nacional de Inteligência Artificial e Computacional, St. Paul, Brazil, 22–25 October 2018; pp. 198–205. [Google Scholar] [CrossRef]
  11. Shi, C.; Tan, C.; Wang, T.; Wang, L. A waste classification method based on a multilayer hybrid convolution neural network. Appl. Sci. 2021, 11, 8572. [Google Scholar] [CrossRef]
  12. Wang, C.; Qin, J.; Qu, C.; Ran, X.; Liu, C.; Chen, B. A smart municipal waste management system based on deep-learning and Internet of Things. Waste Manag. 2021, 135, 20–29. [Google Scholar] [CrossRef]
  13. Luo, Q.; Lin, Z.; Yang, G.; Zhao, X. DEC: A deep-learning based edge-cloud orchestrated system for recyclable garbage detection. Concurr. Computat. Pract. Exper. 2021, e6661. [Google Scholar] [CrossRef]
  14. Bai, J.; Lian, S.; Liu, Z.; Wang, K.; Liu, D. Deep learning based robot for automatically picking up garbage on the grass. IEEE Trans. Consum. Electron. 2018, 64, 382–389. [Google Scholar] [CrossRef] [Green Version]
  15. Sidharth, R.; Rohit, P.; Vishagan, S.; Karthika, R.; Ganesan, M. Deep learning based smart garbage classifier for effective waste management. In Proceedings of the 2020 5th International Conference on Communication and Electronics Systems (ICCES), Coimbatore, India, 10–12 June 2020; pp. 1086–1089. [Google Scholar] [CrossRef]
  16. Gupta, T.; Joshi, R.; Mukhopadhyay, D.; Sachdeva, K.; Jain, N.; Virmani, D.; Garcia-Hernandez, L. A deep learning approach based hardware solution to categorize garbage in environment. Complex Intell. Syst. 2022, 8, 1129–1152. [Google Scholar] [CrossRef]
  17. Canbek, G. Gaining insights in datasets in the shade of “garbage in, garbage out” rationale: Feature space distribution fitting. WIREs Data Min. Knowl. Discov. 2022, 12, e1456. [Google Scholar] [CrossRef]
  18. Yang, M.; Thung, G. Classification of trash for recyclability status. CS229 Proj. Rep. 2016, 2016, 3. [Google Scholar]
  19. Ma, X.; Li, Z.; Zhang, L. An Improved ResNet-50 for Garbage Image Classification. Teh. Vjesn. 2022, 29, 1552–1559. [Google Scholar] [CrossRef]
  20. Mao, W.; Chen, W.; Wang, C.; Lin, Y. Recycling waste classification using optimized convolutional neural network. Resour. Conserv. Recycl. 2021, 164, 105132. [Google Scholar] [CrossRef]
  21. Li, Y.; Liu, W. Deep learning-based garbage image recognition algorithm. Appl. Nanosci. 2021, 1–10. [Google Scholar] [CrossRef]
  22. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef] [Green Version]
  23. Ruder, S. An overview of gradient descent optimization algorithms. arXiv 2016, arXiv:1609.04747. [Google Scholar] [CrossRef]
  24. Lydia, A.; Francis, S. Adagrad—An optimizer for stochastic gradient descent. Int. J. Inf. Comput. Sci. 2019, 6, 566–568. [Google Scholar]
  25. Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar] [CrossRef]
  26. Conger, A.J. Integration and generalization of kappas for multiple raters. Psychol. Bull. 1980, 88, 322. [Google Scholar] [CrossRef]
  27. Chmura Kraemer, H.; Periyakoil, V.S.; Noda, A. Kappa coefficients in medical research. Stat. Med. 2002, 21, 2109–2129. [Google Scholar] [CrossRef] [PubMed]
Figure 1. TrashNet dataset problem images.
Figure 1. TrashNet dataset problem images.
Sustainability 14 14735 g001
Figure 2. Custom Trash-7 dataset representative images.
Figure 2. Custom Trash-7 dataset representative images.
Sustainability 14 14735 g002
Figure 3. Garbage classification process design.
Figure 3. Garbage classification process design.
Sustainability 14 14735 g003
Figure 4. Visual image of the brightening method.
Figure 4. Visual image of the brightening method.
Sustainability 14 14735 g004
Figure 5. Acquisition method of image background pixel points.
Figure 5. Acquisition method of image background pixel points.
Sustainability 14 14735 g005
Figure 6. Image processing process.
Figure 6. Image processing process.
Sustainability 14 14735 g006
Figure 7. CNN structure.
Figure 7. CNN structure.
Sustainability 14 14735 g007
Figure 8. Accuracy changes in the Trash-7 validation set.
Figure 8. Accuracy changes in the Trash-7 validation set.
Sustainability 14 14735 g008
Figure 9. Accuracy changes in the TrashNet validation set.
Figure 9. Accuracy changes in the TrashNet validation set.
Sustainability 14 14735 g009
Figure 10. Image classification confusion matrix.
Figure 10. Image classification confusion matrix.
Sustainability 14 14735 g010
Figure 11. List of software test results: (a) can software test results; (b) face mask software test results; (c) glass software test results; (d) leftover software test results; (e) newspaper software test results; (f) ointment software test results; (g) plastic bottles software test results.
Figure 11. List of software test results: (a) can software test results; (b) face mask software test results; (c) glass software test results; (d) leftover software test results; (e) newspaper software test results; (f) ointment software test results; (g) plastic bottles software test results.
Sustainability 14 14735 g011aSustainability 14 14735 g011bSustainability 14 14735 g011c
Table 1. Optimizer performance comparison.
Table 1. Optimizer performance comparison.
RankingConvergence SpeedStabilityAccuracy
(Unit: %)
1AdamAdadeltaAdamax
(94.59)
2AdamaxAdamaxSGD
(94.01)
3SGDAdamAdagrad
(93.37)
4AdagradAdagradAdam
(93.32)
5AdadeltaSGDAdadelta
(90.94)
Table 2. Comparison of evaluation results (unit: %).
Table 2. Comparison of evaluation results (unit: %).
OptimizerTrash-7
(Not Optimized)
Trash-7
(Optimized)
AccuracyKappaAccuracyKappa
Adamax95.9294.1796.7796.00
SGD94.4193.0696.6294.77
Adagrad94.2392.8495.2094.32
TrashNet
(Not optimized)
TrashNet
(Optimized)
AccuracyKappaAccuracyKappa
Adamax92.3390.6193.7292.31
SGD87.9385.2291.3089.35
Adagrad88.4885.8893.1891.64
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Yang, Z.; Xia, Z.; Yang, G.; Lv, Y. A Garbage Classification Method Based on a Small Convolution Neural Network. Sustainability 2022, 14, 14735. https://doi.org/10.3390/su142214735

AMA Style

Yang Z, Xia Z, Yang G, Lv Y. A Garbage Classification Method Based on a Small Convolution Neural Network. Sustainability. 2022; 14(22):14735. https://doi.org/10.3390/su142214735

Chicago/Turabian Style

Yang, Zerui, Zhenhua Xia, Guangyao Yang, and Yuan Lv. 2022. "A Garbage Classification Method Based on a Small Convolution Neural Network" Sustainability 14, no. 22: 14735. https://doi.org/10.3390/su142214735

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop