Recyclable Waste Classification Using Computer Vision and Deep Learning
Recyclable Waste Classification Using Computer Vision and Deep Learning
Abstract—Recycling solid waste is an important step to manipulation of hazardous materials and can have various
reduce harmful impact such as sanitary and health problems adverse health problems. The application of tags, such as
resulting from the over use of landfills. Yet, recycling requires barcodes and Radio Frequency Identifiers (RFID) have been
the sorting of solid waste, which is complex and expensive. In used and proposed by various studies for efficient sorting of
an attempt to ease this process, our work proposes a Deep waste materials [2, 16, 17,18, 19]. Yet, embedded tags also
Learning approach using computer vision to automatically have a negative impact on the environment [20]. The use of
identify the type of waste and classify it into five main computer vision to classify a particular waste product
categories: plastic, metal, paper, cardboard and glass. Our involves the use of sensors and/or cameras, connected to a
conceptual system consists of an automated recycling bin
system to perform identification and an actuator to perform
which automatically opens the lid corresponding to the type
of waste identified. This work focuses mainly on the Machine
the sorting. We proposed a low cost and energy efficient
Learning algorithms which can be trained for efficient recycling system based on bar codes in [2]. This work
identification. Pre-existing images have been used to train a focuses on enhancing our solution to provide an automated
minimum of 12 variants of the Convolutional Neural Network recycling bin system which can automatically identify the
(CNN) algorithm over three classifiers: Support Vector type of waste being thrown and open the corresponding lid.
Machine (SVM), Sigmoid and SoftMax. Our results show that The main research question focuses on whether Machine
VGG19 with SoftMax classifier has an accuracy of around Learning (ML) algorithms can effectively identify solid
88%. waste materials and classify them into paper, metal, glass,
plastic, food waste and cardboard.
Keywords—Waste Classification, Recycling, Deep
Convolutional Neural Network, Classifiers, Machine Learning, II. LITERATURE REVIEW
Computer Vision Yang et al. [3] used the TrashNet dataset [11] to
I. INTRODUCTION compare two Machine Learning techniques, Support Vector
Machine (SVM) and Convolutional Neural Network (CNN)
Solid waste management is a growing global also known as AlexNet) for the classification of waste into
phenomenon which affects every single human being. five main classes (glass, paper, metal, plastic, cardboard).
Inappropriate management of solid waste leads to water The results demonstrate that the SVM was more efficient
contamination, disease transmission in human and animals with an accuracy of around 63% while the CNN achieved
and increase flooding due to the blocking of drains. These only 22% accuracy. An attempt to classify multiple objects
adverse effects have a direct consequence on economic in a single input has been mentioned as future works.
growth and weighs heavier for developing countries. The
World Bank estimates that 2 billion tonnes of solid waste Adedeji et al. [4] proposed a combination of CNN
have been generated worldwide in 2016, averaging to (ResNet50) with SVM to classify 4 classes of waste (glass,
around 0.74 Kilograms of waste per person [1]. According paper, plastic, metal) and reached an accuracy of around
to the same report, it is expected that waste generation will 87% with data augmentation optimization. The main
increase by 50% in 2030 and 70% in 2050 if no proper limitation of this work was the small dataset size containing
actions are taken. a small number of trash images. It was concluded that their
approach is faster than manual sorting.
The most popular waste disposal method worldwide is
through landfills [1]. This method has a very high damaging A few attempts have been noted using computer vision
impact on the environment, with the release of toxins, for automation of recycling bins. Desai et al. [5] proposed a
leachate and greenhouse gas. Recovery through recycling CNN to classify 2 classes of waste (degradable or non-
and composting can considerably reduce the impact of degradable) to reduce human intervention replacing the
landfills. Recycling inherently consists of a complex and current waste sorting method with a robotic arm based on
expensive process to sort out various waste materials into Raspberry Pi opening the bin. Aral et al. proposed to
different categories such as: metal, glass, plastic and paper. compare different CNN that are Xception, MobileNet,
Some of the existing solutions can be classified into DenseNet, InceptionResNetV2 using the Trashnet Dataset
mechanical sorting, manual sorting, automated [11]. They reached 95% accuracy with DenseNet121
identification with tags and computer vision systems. followed by 95% with DenseNet169 and 94% with
InceptionResNetV2 with data augmentation optimization.
Manual sorting, mainly implemented in developing They increased the size of the dataset using various
countries proves to be more efficient than mechanical techniques, which improved their results. Ziouzios et al. [7]
sorting [15]. Nevertheless, hand picking involves the proposed a low-cost smart bin system using CNN
Authorized licensed use limited to: b-on: Instituto Politecnico do Porto. Downloaded on December 18,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
978-1-6654-0417-4/21/$31.00 ©2021 IEEE 11
(ResNet34) to classify 6 classes of waste(cardboard, glass,
metal, paper, plastic, trash) on TrashNet dataset [11]. They 1
reached a 92% accuracy and used Raspberry Pi to open the SVM
bin where images are sent using LoRaWan connectivity. Classifier
Özkaya et al. [8] ccompared the different CNN
(AlexNet, InceptionV3, ResNet, VGG-16, SquezeeNet) 2
with SoftMax and SVM as classifiers to classify 6 classes CNN Sigmoid
(glass, paper, cardboard, plastic, metal, trash) on the Algorithm Classifier
TrashNet dataset. SVM was more efficient with an accuracy
of 97.86% for InceptionV3 + SVM followed by VGG-16 + Results stored
SVM with 97.46% and AlexNet + SVM with 97.23%. 3 SoftMax for comparison
Authorized licensed use limited to: b-on: Instituto Politecnico do Porto. Downloaded on December 18,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
12
TABLE III: Results for CNN Models
Color Augmentation includes: Brightness, Contrast, ResNet152V2 98.04 71.72 99.01 75.36 99.28 67.24
Contrast and Hue. The images were also resized based on MobileNet 96.80 76.20 99.11 68.27 98.81 70.65
the CNN images input guide available on [13] using
OpenCV library. DenseNet201 97.43 66.81 98.75 61.23 98.97 62.78
NASNetLarge 96.77 74.39 98.78 77.64 98.86 76.35
The Adam optimizer (Adaptive Moment Estimation)
has been used across all the experiments. As mentioned by NASNetMobile 93.14 72.47 97.0 73.91 97.83 73.34
Bircanoglu et al. in [9], Adam optimizer is more efficient
than Adadelta in the context of trash classification when
using the proposed TrashNet dataset. Also, Adam is To better compare and interpret the results, a second
computationally efficient and has a small memory footprint. experiment was conducted, whereby all non-performing
models were eliminated. The approach consisted of 256 +
50 epochs and Adam set to value 0.001, with SoftMax,
D. Experimental Setup SVM and Sigmoid classifiers. Following this experiment,
All the experiments for this study were carried on a the five most performing models have been identified,
laptop with configuration described in Table 2. The main namely: VGG16 with SVM, VGG19 with SVM, VGG16
software used are Anaconda [20] and CUDA [21] using with Sigmoid, VGG16 with SoftMax and VGG19 with
Keras library [22] with TensorFlow [23] and OpenCV [13]. SoftMax. These five models where further trained on 256 +
100 epochs and the results are depicted in Table 4.
TABLE IV: Five Best Performing Models
TABLE II: Hardware Configurations
Model & Train Train Test Test Training
CPU Processor Intel(R) Core (TM) i7-9750H Classifier Accur Loss Accu Loss Time
CPU @ 2.60GHz, 6 Cores, 12 Logical acy racy (hours)
Processors
% %
GPU NVIDIA GeForce GTX 1660 Ti
VGG16 + 98.5 0.0221 87.3 0.7522 2.13
RAM 16.0 GB SVM
HARD DISK 256GB NVMe KINGSTON SSD VGG19 + 97.4 0.0385 87.3 0.7649 2.00
SVM
VGG16 + 98.1 0.0496 87.6 0.7649 2.00
IV. RESULTS Sigmoid
The first set of experiment consists of using SVM, VGG16 + 98.2 0.0491 87.7 0.6042 2.18
Sigmoid and SoftMax classifier on 256+50 epochs and SoftMax
Adam set of 0.001 on all the 12 different models, and the
VGG19 + 96.6 0.0979 87.9 1.075 2.25
results are depicted in Table 3. SoftMax
Using SoftMax classifier, most of the models reached
above 96% of training accuracy except for VGG19 which
tops at 93%. For the test accuracy, VGG19 reached around The first two models from Table 4 reached a test
84% followed VGG16 and ResNet101V2 of 83% and 80% accuracy of around 87%, while the remaining models
respectively. The others have more than 60% of test reached around 88%. VGG19+SoftMax proved to be the
accuracy. most accurate as it can be depicted in Figure 4. This is
mainly due the deep 19 layered approach of VGG19.
Authorized licensed use limited to: b-on: Instituto Politecnico do Porto. Downloaded on December 18,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
13
Compared to the traditional CNN or VGG16, the depth of may yield lower accuracy after the application of fine-
layers makes a major difference, with a minor increase in tuning and data augmentation. Yet, data augmentation
training time. greatly contributes to the reduction of overfitting risks [26
,27, 28]. It is also expected that the collection of images for
an operational smart bin system keeps on increasing, as
such, our approach already caters for a reasonable offline
training time with the large dataset resulting from the data
augmentation process. Still, we have considered the basic
standard algorithms, without any fine-tuning. Manual
parameter configuration or use of Nature Inspired
Algorithms in the likes of the BAT [24] or ANT Colony [25]
can be considered to better fine-tune the model and improve
the test accuracy.
V. CONCLUSION
In an attempt to find the best possible Machine Learning
algorithm for the detection of recyclable trash, we compared
12 versions of CNN over 3 different classifiers. We
designed and run all the experiments and our results
demonstrate that the VGG19 with SoftMax classifier
achieved an accuracy of around 88%. It successfully
classifies waste into 5 different classes (glass, paper, plastic,
metal, cardboard). Although 6 classes of waste were
desirable, as per the main research question. Only five were
achieved, leaving out the food waste. This is mainly due to
the limitation with the dataset. In specific cases, the results
Fig. 4. Selected model VGG19 + SoftMax Train vs Test Accuracy and
Train vs Test Loss. achieved demonstrate some degree of improvement
compared to other approaches. Nevertheless, fine tuning
In an attempt to benchmark and further analyze our and optimization are required before implementing the
results, a comparative analysis is presented in Table 5 solution in an automated recycling bin system.
below. Results from our experiments have been compared
with results mentioned in the literature review. VI. LIMITATIONS AND FUTURE WORKS
The future work focuses on two main aspects: 1) data
TABLE V. COMPARISON OF THE PROPOSED MODEL and model optimization and 2) recognition of trash from
No. Fine - Data images containing multiple objects/classes. For the first
Ref
of
Model Used
Tuni Augme Accurac task, the data set used have images on a white background
Class ng ntation y (%) which is taken into consideration during the training by all
es
No No
the models. Therefore, when images with other color/type
[3] 5 SVM 63.0 of background is used, the accuracy is not as expected.
ResNet50 + No No From Figure 5 below, we can note that the model failed for
[4] 4 87.0
SVM
Yes No
the last image, predicting it as paper instead of plastic.
DenseNet121 95.0
DenseNet169 Yes No 95.0
[6] 6
InceptionRes Yes No
94.0
NetV2
[7] 6 ResNet34 Yes No 92.1
Inception Yes Yes
87.0
ResNetV2
[8] 6 DenseNet121 No No 85.0
RecycleNet Yes Yes 81.0 Fig. 5 Images tested on VGG19 with SoftMax model.
[10] 4 VGG16 No No 93.0
The next step consists of improving the results of the
Propos No Yes
ed 5
VGG19 +
87.9 current experiments for the top five models by
SoftMax implementing various ML optimization techniques.
Model
Eventually, once the accuracy of the algorithm improves,
real time detection via webcam or smartphone camera using
Our proposed model is more accurate than the SVM of segmentation algorithms with an IoT device like Raspberry
[3], ResNet50+SVM of [4] and the DenseNet212 and Pi to automatically open a bin lid can be implemented in the
RecycleNet of [9]. Still, it has maximum of 7% less prototype.
accuracy than the results of [6] and [10]. Further analysis
reveals that data augmentation of the original TrashNet REFERENCES
dataset is a major factor contributing to the lower accuracy [1] Kaza, Silpa; Yao, Lisa C.; Bhada-Tata, Perinaz; Van Woerden,
level of the proposed approach. The results presented by O. Frank. 2018. What a Waste 2.0 : A Global Snapshot of Solid Waste
Umut and L. Seyfi. [8] also demonstrates that some models
Authorized licensed use limited to: b-on: Instituto Politecnico do Porto. Downloaded on December 18,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
14
Management to 2050. Urban Development;. Washington, DC. [23] TensorFlow. [Online]. Available: [Link]
[Link] [Accessed: 17-Feb-2021].
[2] G. Suddul and N. Nedoomaren, “An Energy Efficient and Low-Cost [24] Yang XS. (2010) A New Metaheuristic Bat-Inspired Algorithm. In:
Smart Recycling Bin,” International Journal of Computer González J.R., Pelta D.A., Cruz C., Terrazas G., Krasnogor N. (eds)
Applications, vol. 180, no. 29, pp. 18–22, 2018. doi: Nature Inspired Cooperative Strategies for Optimization (NICSO
10.5120/ijca2018916698. 2010). Studies in Computational Intelligence, vol 284. Springer,
[3] Y. Mindy, and G. Thung. “Classification of Trash for Recyclability Berlin, Heidelberg. [Link]
Status.” [Link] [25] M. Dorigo, M. Birattari and T. Stutzle, "Ant colony optimization,"
[Link]. in IEEE Computational Intelligence Magazine, vol. 1, no. 4, pp. 28-
[4] O. Adedeji and Z. Wang, “Intelligent Waste Classification System 39, Nov. 2006, doi: 10.1109/MCI.2006.329691.
Using Deep Learning Convolutional Neural Network,” Procedia [26] Shorten, C., Khoshgoftaar, T.M. A survey on Image Data
Manufacturing, vol. 35, pp. 607–612, 2019. doi: Augmentation for Deep Learning. J Big Data 6, 60 (2019).
10.1016/[Link].2019.05.086. [Link]
[5] Y. Desai, A. Dalvi, P. Jadhav, and A. Baphna. 2018. “Waste [27] Gu, Shanqing; Pednekar, Manisha; and Slater, Robert (2019)
Segregation Using Machine Learning.” International Journal for "Improve Image Classification Using Data Augmentation and
Research in Applied Science & Engineering Technology Neural Networks," SMU Data Science Review: Vol. 2 : No. 2 ,
(IJRASET) 6(3). [Link] Article Available at:
[6] R. A. Aral, S. R. Keskin, M. Kaya, and M. Haciomeroglu, [Link]
“Classification of TrashNet Dataset Based on Deep Learning [28] A. Mikołajczyk and M. Grochowski, "Data augmentation for
Models,” 2018 IEEE International Conference on Big Data (Big improving deep learning in image classification problem," 2018
Data), 2018. doi:10.1109/bigdata.2018.8622212. International Interdisciplinary PhD Workshop (IIPhDW), 2018, pp.
[7] D. Ziouzios and M. Dasygenis, “A Smart Recycling Bin for Waste 117-122, doi: 10.1109/IIPHDW.2018.8388338.
Classification,” 2019 Panhellenic Conference on Electronics &
Telecommunications(PACET),2019.
doi:10.1109/pacet48583.2019.8956270.
[8] O. Umut and L. Seyfi. 2018. “Fine-Tuning Models Comparisons on
Garbage Classification for Recyclability.” 2nd International
Symposium on Innovative Approaches in Scientific Studies.
[Link]
Tuning_Models_Comparisons_on_Garbage_Classification_for_Re
cyclability.
[9] C. Bircanoglu, M. Atay, F. Beser, O. Genc, and M. A. Kizrak,
“RecycleNet: Intelligent Waste Sorting Using Deep Neural
Networks,” 2018 Innovations in Intelligent Systems and
Applications (INISTA), 2018. doi:10.1109/inista.2018.8466276.
[10] B. S. Costa, A. C. S. Bernardes, J. V. A. Pereira, V. H. Zampa, V. A.
Pereira, G. F. Matos, E. A. Soares, C. L. Soares, and A. F. Silva,
“Artificial Intelligence in Automated Sorting in Trash
Recycling,” Anais do XV Encontro Nacional de Inteligência
Artificial e Computacional (ENIAC 2018), 2018.
doi:10.5753/eniac.2018.4416.
[11] “TrashNet-data,” Google Drive. [Online]. Available:
[Link]
11Ul83TEE.
[12] Gary Thung, “garythung/trashnet,” GitHub, 10-Apr-2017. [Online].
Available: [Link]
[13] “TACO Dataset,” Available: [Link]
[14] Tchobanoglous, G. & Kreith, F., Handbook of solid waste
management. Second edition edition. New York, McGraw-Hill,
2002.
[15] Saar, S., Stutz, M. & Thomas, V. M. (2004) Towards intelligent
recycling: a proposal to link bar codes to recycling information.
Resources, Conservation & Recycling. 41 (1), 15-22.
[16] Saar, S. & Thomas, V. (2002) Toward Trash That Thinks: Product
Tags for Environmental Management. Journal of Industrial Ecology.
6 (2), 133-146.
[17] Tsao, Y., Linh, V. & Lu, J. (2017) Closed-loop supply chain network
designs considering RFID adoption. Computers & Industrial
Engineering. 113 716-726.
[18] Torres-Garcia, A., Rodea-Aragon, O., Longoria-Gandara, O.,
Sanchez-Garcia, F. & Gonzalez-Jimenez, L. E. (2015) Intelligent
waste separator. Computacion Y Sistemas. 19 (3), 487-500.
[19] Abdoli, S. (2009) RFID application in municipal solid waste
management system. International Journal of Environmental
Research. 3 (3), 447-454.
[20] “The World's Most Popular Data Science Platform,” Anaconda.
[Online]. Available: [Link] [Accessed: 17-
Feb-2021].
[21] “CUDA Toolkit,” NVIDIA Developer, 05-Jan-2021. [Online].
Available: [Link] [Accessed:
17-Feb-2021].
[22] K. Team, “Simple. Flexible. Powerful.,” Keras. [Online]. Available:
[Link] [Accessed: 17-Feb-2021].
Authorized licensed use limited to: b-on: Instituto Politecnico do Porto. Downloaded on December 18,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
15