Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
13 views10 pages

Waste Management Using Machine Learning

The document discusses a research study on automated waste management using Machine Learning and Deep Learning algorithms, focusing on waste classification into six categories. The study compares the performance of various algorithms, finding that Convolutional Neural Network (CNN) achieved the highest classification accuracy of around 90%. The research aligns with the United Nations Sustainable Development Goals, emphasizing the importance of effective waste management for environmental sustainability.

Uploaded by

nmevanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views10 pages

Waste Management Using Machine Learning

The document discusses a research study on automated waste management using Machine Learning and Deep Learning algorithms, focusing on waste classification into six categories. The study compares the performance of various algorithms, finding that Convolutional Neural Network (CNN) achieved the highest classification accuracy of around 90%. The research aligns with the United Nations Sustainable Development Goals, emphasizing the importance of effective waste management for environmental sustainability.

Uploaded by

nmevanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

Waste Management Using Machine Learning and


Deep Learning Algorithms
Khan Nasik Sami, Zian Md Afique Amin, Raini Hassan
Department of Computer Science, Kulliyyah of ICT, International Islamic University Malaysia, Kuala Lumpur, Malaysia.
[email protected], [email protected], [email protected]

Abstract— Waste management is one of the essential issues that the world is currently facing, and it does
not matter if the country is developed or underdeveloped. The key issue in this waste segregation is that the
trash bin at open spots gets flooded well ahead of time before the beginning of the cleaning process. The
cleaning process involves with the isolation of waste that could be due to unskilled workers, which is less
effective, time-consuming, and not plausible because the reality is, there is a lot of waste. So, we are
proposing an automated waste classification problem utilizing Machine Learning and Deep Learning
algorithms. The goal of this task is to gather a dataset and arrange it into six classes consisting of glass,
paper, metal, plastic, cardboard, and waste. The model that we have used are the classification models. For
our research we did the comparisons between three Machine Learning algorithms, namely Support Vector
Machine (SVM), Random Forest, and Decision Tree, and one Deep Learning algorithm called Convolutional
Neural Network (CNN), to find the optimal algorithm that best fits for the waste classification solution. For
our model, we found CNN accomplished high characterization on classification accuracy, which is around
90%, while SVM indicated an excellent transformation to various kinds of waste, with 85% classification
accuracy, and Random Forest and Decision Tree have accomplished 55% and 65% classification accuracy
respectively.

Keywords— waste classification, image classification, machine learning, deep learning, random forest,
support vector machine, decision tree, convolutional neural network, sustainable development goals.

Machine learning can carry a decent output for solving this


I. INTRODUCTION alarming issue and to keep our environment a good place for
The production of waste has increased dramatically in all to live in.
recent times. If waste is not managed properly, it can have In 2015, United Nations has created 17 Sustainable
a calamitous effect on the environment. So, the sorting of Development Goals (SDGs) which are also known as the
waste should be done at the initial stage of waste global goals to end poverty, save the planet and ensure that
management, to maximize the number of recyclable items all people enjoy peace and prosperity by 2030. Based on the
and reduce the possibility of contamination by other items. SDGs goals, we have taken our project as a milestone to
The isolation of waste is done by unprofessional workers solve some of the problems that almost all the nations are
which is less effective, time-consuming, and not efficient facing. In line with the United Nations Sustainable
because of a lot of waste. The world creates nearly one and Development Goals, this project aids in realizing goal
half a billion tons of civil strong waste every year. As per the number 14 by wiping out the residues of plastic fishing nets,
World Bank, and that figure is predicted to hit 2.2 billion tons cigarette butts, and other categories of waste from the
by 2025. Diversion of plastics from landfill to reusing can ocean coast [1]. Large marine mammals are washing up on
conceivably spare what might be compared to 60 million shore dead, their bellies so full of plastic that they have
barrels of oil every year and lessen landfill volume starved. This research supports goal number 15 because life
necessities by up to 20%. The U.S. Natural Protection Agency on land (SDG 15) can only be healthy when waste is properly
has suggested that source decrease, reusing, volume managed. Again, waste is polluting the air when there is no
decrease, and landfilling be applied, in a specific order, in the management. With the burning of plastics everywhere the
treatment of city strong waste (MSW). Again, the economic health impacts of open burning are catastrophic (SDG 3) [1].
value of waste is huge after it is segregated. The waste Ensuring healthy lives and promoting well-being for all at all
becomes valuable if it is segregated and recycled using the ages is the main aim of SDG3. Moreover, climate change, the
recent advancements in technology thereby becomes a impact of methane and CO2 from poorly managed waste will
useful entity. So, the execution of Artificial Intelligence and be a reason for up to a tenth of manmade greenhouse gas.

97
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

So, it will hamper goal number 13, which indicates the 4. To do analyze the results based on performance
climate impact (SDG 13) for our environment. And lastly, if evaluation
we want clean water and proper sanitation (SDG 6), we 5. To find out the best suitable algorithm for this
need to be looking at waste to be managed properly [1]. So, research problem
our research carries a high value for sustainable
development goals. II. RELATED WORKS
For conducting the study, a couple of research questions Many different algorithms have been developed and used
were formulated to guide the research, and they are as the to solve the problem of classifying images properly. Some of
following: them are CNN, SVM, Random Forest, Artificial Neural
Network (ANN), Decision Tree, ResNet-50, VGG-16, AlexNet,
1) What are the waste categories for segregation in this
KNN, etc.
research: Finding out whether a waste is paper, plastic,
This section includes finding from the literature reviews
metal, glass materials or cardboard is the main target of this
that was done to get an idea of similar works on this domain.
research. According to our training data provided in the
There are several pieces of literature that we referred to in
dataset, we tried to determine the testing data be detected
this paper.
by comparing the attributes of given examples.
Along with the SVM algorithm, Random Forest Classifier,
2) What are the key features determining the correct object: Gaussian Naive Bayes, and Multilayer Perceptron were used
At first the model takes an input picture at that point and to detect different waste categories [2]. A diversified set of
separate the locale for that. At that point, it compares the tree structures known as Bootstrap aggregating and
features with the past trained data, and toward the end, it selecting the right number of trees played a vital role in
orders whether the provided data or object is matched with getting higher accuracy.
the trained model and how much is the accuracy. To show A different approach was taken with the use of IoT
signs of improvement accuracy it is smarter to do some devices, ESP8266 Wi-Fi chip, Servo Motor, and Mobile app
increase in the preparation information, so the object can be to automatically segregate the waste. Where IoT devices
analyzed with different angles and views. It is additionally helped to count and monitor the type of waste and its
better to do reshaping in the pre-processing stage to keep quantity in mobile phones via an app [3].
all cases in a similar size. Similarly, the study [4] shows the use of Raspberry Pi 3
B+, Raspberry Pi Camera v2, Servo Motor, Linkit One, IR
Our research hypothesis is as the following:
Collision Sensor, Ultrasonic Sensor, Temperature and
By implementing the classification algorithms: Support Humidity Sensor, GPS, AWS Io Core. All of them are
Vector Machine (SVM), Decision Tree, Random Forest and connected and trained with a Machine learning model called
Convolutional Neural Network (CNN), the model helps to Inception V3.
see how the items can fluctuate from one another relying Another study [5] shows the use of Raspberry Pi, l293d
upon different factors, for example, comparing the Motor Driver, Webcam, DC motors, Inductive Sensors along
greyscale images or red-green-blue (RGB) value that can be with Machine Learning algorithm SVM solves the problem of
ranged between 0 and 255. These qualities would then be segregating waste in domestic life.
able to be placed into a cluster. Another way is separating The study by [6] introduces Computer Vision
the pictures into little pieces and afterward placing them implementation along with Deep Learning. It used HOG,
into neural layers and every one of the neural systems is Gabor, Sliding window CNN, GarbNet (FCN with LRN).
placed into an exhibit. At that point, we need to resize it GarbNet with LRN processes six times faster output with
while holding the subtleties of the picture. Then we must better accuracy in this study. The model was deployed in a
resize it while retaining the details of the image. After mobile app named SpotGarbage.
considering all the factors, the model predicts the accuracy Different sizes of decision trees and random forest were
of how likely an object match the trained sample. applied in this experiment. SVM, Decision Tree, Random
Forest were then again added with Principal Component
Finally, the objectives of our research are given
Analysis (PCA) on the trashnet dataset.MobileNetV2 's
below:
lightweight neural network was trained by migration and
1. To explore the dataset, which involves analyzing each transformation and used for extracting features, and the
feature variables to check if the variables are extracted features were integrated for classification into
significant for building the model. SVM [7]. This method solves the overfitting problem by
2. To visualize the dataset and identify the incorrect implementing transfer learning.
images. Pearson Correlation Coefficient (PCC) and Spearman
3. To build the model that classifies the images and then Rank Order Correlation Coefficient (SCC) were used to
sort them according to the classes

98
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

estimating the performance of neural networks. Among about the feature [17]. The MHS uses a CNN-based
AlexNet, VGG-16, SVM, KNN, and Random Forest, VGG-16 has algorithm to extract image features and a method of
been the most accurate and computationally efficient model consolidating image features and other feature details with
in the study [8]. multilayer perceptron (MLP) to identify waste as recyclable
Integrated sensor, microcontroller and IoT cellular or other waste
module, Mobile app combined with J48, Random Tree,
Random Forest classifier, K-means algorithms, and Ant III. METHODOLOGY
Colony Optimization were implemented in the study [9]. A. Data Collection and Splits
After the updating of weights and bias by using Stochastic
Gradient Descent with Momentum(SGDM) in the neural For the dataset, we have utilized the waste image
network, the fully connected layers were replaced by SVM dataset which was created by Gary Thung and Mindy Yang.
[10]. This hybrid model was able to get high accuracy in Dataset was available in the internet sources and the owner
identifying waste objects. of the dataset was permitted to use for any kind of research
However, in [11], the researchers used a smaller filter purpose. The dataset contains 2500 pictures of different
quantity and size of AlexNet with Adam gradient descent garbage which are cardboards, metal, plastic, paper, glass,
optimization and the SVM for comparison. metals. We have divided the dataset into training, testing,
Again, two popular learning algorithms were used which and validation pictures. The training set comprises 80% and
are CNN and SVM. The researchers chose 256*256 colored the test set contained 20% of the data.
png images and implement them on raspberry pi 3 [12]. It B. Tools
only compares two algorithms then finds out the best model
We mainly used Google colab and python for our
with the measurement of speed and classifications.
experimental setup and analysis process.
For the classification system, several kinds of decision
 Google Colab: Google Colab is a free cloud
trees have been introduced to find active objects by multi-
administration where we can do the coding part. One
wavelength data, such as REPTree, Random Tree, Decision
of the major features of the colab is that we can easily
Stump, Random Forest, J48, NBTree, AdTree [13]. These
change the runtime. For our research as the dataset
decision tree approaches are in the WEKA package. In the
is big, we use GPU runtime. One can improve your
process of classification by decision tree methods, the
Python programming language coding aptitudes.
classification rules are easily obtained, moreover, these
 Python: Python is a programming language that we
methods are clear and easy to visualize.
mainly used in this research. It is a high-level, object-
Various random forest approaches also have been used in
oriented programming language with dynamic
the field of image classifications. E.g., shape and
semantics. It has a syntax that allows developers to
appearances representations that support spatial pyramids,
write programs in fewer lines comparing with other
automatic selection of the regions of interest in training, and
kinds of programming language. It has a verse utility
the use of random forests as a multi-way classifier [14].
in the field of GUI development, web development,
The numerous low-level characteristic features such as
scientific development, and software and system
color, shape, texture of the image form the various domains
administration.
of the decision tree among others. The researchers
 Machine Learning algorithm(s) utilized, along with
discussed the algorithm to calculate the relative distance
numerical equation(s).
between the retrieved results as a subprocess required in
this approach [15]. C. Algorithms
Another research has shown that the Python index To build our model on the trash image dataset, we have
package of Spyder is used to detect and segregate the waste used four algorithms, which are the SVM, Random Forest,
material in real-time through a webcam [16]. The research Decision Tree and CNN. The functionality of the classification
proposes an intelligent waste classification system using the
algorithms is basic. You foresee the objective class by
CNN algorithm, a Deep Learning based image classification dissecting the preparation dataset. The following describe
model is used in the paper so that the bio and non- the technical details of each algorithm:
biodegradable objects can be classified based on the object
 SVM:
recognition accuracy in real-time. Open-source library tensor
To solve binary classification problem, the SVM was
flow has been used in the research.
developed [18]. The objective was to find the optimal
Multilayer hybrid deep-learning system (MHS) is another
hyperplane f (w,x) = w. x+ b to segregate two classes from
approach that can automatically sort waste of by individuals.
the provided data, with the features x ∈ ℝ𝑚 . By solving the
This system deploys a high-resolution camera to capture
optimization problem stated in (EQ. 1), SVM learns the
images of waste and sensors to detect other useful details
parameter w.

99
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

1 𝑝
𝑚𝑖𝑛 𝑤 𝑇 𝑤 + 𝐶 ∑𝑖=1 max⁡(0,1 − ⁡ 𝑦𝑖ˊ ⁡(𝑤 𝑇 𝑥𝑖 + 𝑏)) (1) of the layer in fully connected layers are fully connected
𝑝
to all activation neurons of the previous layer [13]. The
Here 𝑤𝑇 𝑤 w is the Manhattan norm(L1 norm),the penalty
fully connected function can be expressed as the
parameter is 𝐶 ,⁡𝑦𝑖ˊ ⁡ is the actual label, and 𝑤𝑇 𝑥𝑖 + 𝑏 is the following forward:
predictor function. The above equation is known as L1-SVM, ∑XiL+1=∑Wj,iL+1XiL,
with the standard hinge loss. More stable result is shown by giL =∑Wj,iL+1gjL (7)
the counterpart of L1-SVM, which is known as L2-SVM(Eq.2). L L
Where Xi and gi indicates the activation and the
1 𝑝
𝑚𝑖𝑛 ‖𝑤‖22 + 𝐶 ∑𝑖=1 max⁡(0,1 − ⁡ 𝑦𝑖ˊ ⁡(𝑤 𝑇 𝑥𝑖 + 𝑏))2 (2) gradient of neurons i at layer L and W j,iL+1 is the weight
𝑝
Here‖𝑤‖22 refers to the Euclidean norm (L2 Norm), with connecting neurons i at layer L to neurons j at layer L+1.
the squared hinge loss.
D. Performance Measurement
 Random Forest: To measure the performance of our algorithms, we took
As our problem was regarding to the classification help from some of the performance measures features such
problem, we used Gini index formula to decide how the as confusion matrix, precision, recall, F1-score, accuracy, and
nodes on a decision tree branch[10]. cross-validation. We have defined them briefly next in the
𝐺𝑖𝑛𝑖 = 1 − ⁡ ∑𝑐𝑖=1(𝑃𝑖 )2 (3) implementation part.
E. Data Preparation & Pre-Processing
To evaluate the Gini of each branch on a node, this
formula uses the class and probability to determine which of As the information utilized in this test is an assortment of
waste-related pictures, there should be some pre-
the branches is more likely to occur. Here, 𝑃𝑖 is the relative
processing on them to change over the information in the
frequency of the class in the dataset that we are studying,
configuration that can be taken care of to the AI models.
and c is the number of classes.
Pictures in the training dataset had contrasting sizes, hence
We have also used the entropy to decide how nodes pictures must be resized before being utilized as a
branch in a decision tree. contribution to the model. Waste images were resized to
𝐸𝑛𝑡𝑟𝑜𝑝𝑦 = ∑𝑐𝑖=1 −𝑃𝑖 ∗ 𝑙𝑜𝑔2 (𝑃𝑖 ) (4) the shape of 512*384 pixels from the original dataset and
To decide about how the node should branch, Entropy moved to separate directory. We then converted our
dataset into greyscale images with dimension of 50*50
uses the likelihood of a certain result. Owing to the
pixels increasing the computation speed. On this converted
logarithmic function used in calculating it, it is more
data, we have built our models.
mathematically intensive, unlike the Gini index.
 Decision Tree: IV. MODELLING
In Decision Tree, Information Gain is one of the Attribute A. SVM
to further describe the tree. It mitigates the data necessary SVM makes all the difference because it includes complex
to classify the data points into the respective partitions and kernel groups such as RBF (Radial Bias Function), Neural
represents the least randomness or "impurity" in those Network class, and polynomial classifiers, yet it is easier to
partitions. analyze SVM.
Info (D) =-∑𝑚 0 𝑝ilog2(pi) For the SVM in a high dimensional element that is non-
𝑣 𝐷𝑗
InfoA(D)=⁡∑𝑗=1 xInfo(Dj) (5) linearly connected to input space, it relates to a direct
𝐷
Here [19], pi is the probability in the dataset D belongs to method, but in that high dimensional space, it does not
Class Ci and is estimated by |Ci,D|/|D|. Info (D) is simply involve any complex calculations. With the support of
meaning the amount of information needed to identify the kernels, any single significant figure and calculation take
class of a Data point D. Info(D) is also known as the entropy place in the input space.
of the dataset D. The minimum function is the Optimal Hyperplane
The information gain can be calculated as follows: indicator, which is accurately the maximum range of the
separation distance between the two classes. By applying a
Gain(A)= Info(D)=InfoA(D) (6) quadratic function that makes it sufficiently streamlined to
 CNN: obtain the maximum optimized patterns lying on its margin,
CNN is individual in its 3D volumes of a neuron: width, this hyperplane is formed. These examples are referred to as
height, and depth. CNN consists of a sequence of support vectors containing data related to classification.
convolutional layer, pooling layers, fully connected layers. As a result of its bits accessible for various types of
Only a small region of the previous layer will connect the information, SVM are advantageous for using it. With its
neurons in the convolutional layer. The activation neurons default use, based on a hyperplane, it isolates two explicitly
divisible groups. The LSVM (Linear SVM) is this kind of SVM.

100
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

By considering the limits of a dataset, all the accessible  SVM and Boosting calculations can be contrasted
preparing vectors are then split into a couple of groups and with easy-to-use parameters and are less sensitive to
the hyperplane is chosen with the aim that these support those parameters.
vectors are at the base of the hyperplane. Therefore,  Compared to individual decision trees, a smaller issue
according to SVMs, to classify any class rather than full of overfitting and thus pruning of trees can be
training examples, only these support vectors are important. avoided.
As indicated by SVM, it is only these support vectors that  The accuracy is improved by the automated
are required to group any class instead of the total identification of outliers and essential variables and
preparation models. D+ and D usually mean the distinction Random Forest is therefore much easier to use. Each
between the support vectors and the hyperplanes, while the advantage, however, also comes with its own set of
margin of the isolating hyperplane is the whole of each of limitations. Random Forest confinement has been
these separations. investigated up until now is that prediction is limited
In this case, the assumption of linear separation of the to a specific range of response values in the test set
data was not there because it was a multi-class classification due to regression trees. Thus, it turns out to be true
problem. We may use a feature in such circumstances to that preparation information requires a full range of
change our information into a higher dimensional space. A reaction factors and all examples ought to have all
simple polynomial function can be activated to access scope of reaction information esteems.
information to turn it into a parabola of information focuses.
But this method can be very costly to pursue C. Decision Tree
computationally and can therefore be used in such cases The decision to make strategic divisions greatly influences
with a kernel trick. This associate with using a capacity that the accuracy of a tree. For characterization and regression
takes as its data the vectors in the first space and results in trees, the decision models are diverse. To choose to split a
a spot outcome of the vectors in the component space. This node into at least two sub-nodes, decision trees use various
converts the vectors from a nonlinear space to a linear space calculations. The homogeneity of the resulting sub-nodes is
in the long term. built by the formation of sub-nodes. As such, we can assume
that the value of the nodes increases as far as the objective
B. Random Forest variable is concerned. From each available variable, it forms
Random Forest is a very well-known classifier used for Decision Trees.
multi-class classification. It uses several number of distinct Decision Trees are divided into two groups, based on the
decision trees, and these trees work for randomization. The target variables.
leaf nodes of each tree are the lowest level of the tree and  Decision Trees Categorical Variable: This is where the
are the distribution over the class of images. As it is sent algorithm has a goal categorical variable. In the
down at each node and tree, the image is labeled, and the process of classification, the decision tree learns from
collected value is determined towards the end of leaf various features of the data, and it ends up at a leaf
circulation. node of one of the six categories of targets after
In two different ways, randomization is a part of the passing each data point through each node.
calculation. One is by sub-sampling the dataset in the  Continuous Variable Decision Trees: In this case, the
training period and choosing node tests. Inspecting input features of the decision trees are used to
methodology assumes a significant job in the outcome estimate a continuous output. This is used to solve
classification. regression problems. splits the nodes and then
One of the study presented a contextual overview of selects the split that causes the most homogeneous
three angles within the preparation test, which were test sub-nodes.
size, spatial autocorrelation, and class extent[20]. Random
Forest Image Classification has demonstrated sensitivity to D. CNN
variables such as class proportions, sample size, and training CNN is one of the main parts of Neural Networks. It is
data characteristics. used widely in image recognition and classification to detect
To improve execution and accuracy, Random Forest various objects, recognize faces, and so on. CNN is made up
classifications should be reproduced in any event, it is of neurons that can learn weight and biases.
already an ensemble approach to regression modelling and The components in CNN can be divided into few
classification. Every algorithm has its benefits and segments:
drawbacks.  Convolutional Layer: It is the first layer of CNN.
Random Forest advantage points include: Convolution is the primary layer to separate
highlights from an input picture. Convolution

101
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

protects the connection between pixels by learning subcategories of the data and resized and converted them
images features utilizing little squares of information. to the vector type using the flatten function. Then we have
It is a numerical activity that takes two sources of info, saved the preprocessed data in pickle format so that we can
for example, an image matrix and a filter or kernel. use the saved pickle afterward. We have shuffled the data
 Max Pooling Layer: Max pooling is a pooling activity which is an important part of getting an unbiased result for
that chooses the greatest element from the locale of the prediction.
the feature map covered by the channel. Thus, the After splitting the data into training and testing data, we
output after the max-pooling layer would be an created the model for SVM using SVC. For the first testing,
element map containing the most conspicuous we used the kernel to ‘rbf’, C=10, and kept the gamma to
highlights of the past component map. This layer auto. Then for this configuration, the model was able to
manages to let the examining and preparing time. predict the waste with an accuracy of 86%. Then we tried to
 Dropout Layer: Dropout is a procedure used to keep optimize the model with hyperparameter tuning and for this,
a model from overfitting. Dropout works by we have used the Grid Search method. It exhaustively
randomly setting the active edges of hidden units generates candidates from a grid of parameter values. It
(neurons that makeup concealed layers) to 0 at each goes to all the possible values provided. It took 22.4 minutes
update of the training stage. Normally, dropout is put for our provided configurations to execute with 80 different
on the completely associated layers simply because possible outcome tests. Then they provided an accuracy of
they are the ones with the more prominent number 86.2% which is the same as before. Then we tried again with
of parameters and in this manner, they are probably it with 3 different kernel types, 4 different range of values
going to unnecessarily co-adjusting causing for C. This time the accuracy was 85% but the score for the
overfitting. confusion matrix was better than before.
 Flattening Layer: After finishing the last stages, we
B. Random Forest
should have a pooled include map at this point. As the
name of this progression suggests, we are in a real A random forest classifier is a model combining many
sense going to flatten our pooled include map into a decision trees. It samples random training data points while
column. The explanation we do this is that we need building the trees. It adds additional randomness in the
to embed this information into an ANN later. What model if the number of trees grows. It creates a forest with
occurs after the leveling step is that you end up with many trees that are not correlated. Random Forest is a
a having long vector of input features that go bagging algorithm for achieving low-prediction error.
through the ANN to have it prepared further. Firstly, we imported the random forest classifier after all
 Dense Layer: Dense layers add an intriguing non- the preprocessing with n_estimatiors=10 which means with
linearity property, in this manner they can show any ten trees, criterion as entropy, and with 50 random states.
numerical function. Nonetheless, they are yet limited With this configuration, when we increased the number of
as in for a similar input vector we get consistently a estimators, the accuracy slightly increased. Then we tried to
similar output vector. They cannot identify optimize it with a random search optimizer as the
reiteration as expected or produce various answers hyperparameter tuning technique. It takes random
on a similar input. configurations from the provided options. It can narrow
 Fully Connected Layer: A fully connected layer mainly down the possible outcomes which reduce the computation
takes all the output from the previous pooling or time. For the cross-validation, we used a stratified K-fold
convolution layer and depict the correct image or validation technique where the randomness of the data is
classify the correct label. The fully connected layer confirmed. It gave us the optimal configuration for testing.
(flatten) receives the output from the previous layers The cross-validation score increased to 70 which was
and then flatten them and create a single vector that previously 65. But the accuracy was unchanged which is 55%
can be an input for the following stage. After for our data set. Also, the other performance measurement
receiving the input, the layer applies weight to scores were increased after tuning with random search.
anticipate the correct label. The fully connected C. Decision Tree
output layer shows the last probability for each
It provides the result as a graphical representation like a
object.
flowchart where each node of the tree represents test cases.
V. IMPLEMENTATION Each branch represents the outcomes from the test and the
nodes represent the class labels.
A. SVM After all the preprocessing, we have made the classifier
We have imported all the necessary libraries and specified for the decision tree model. We used entropy as the criterion
the data categories. In the next step, we have joined all the and the depth of the tree we gave the value as 10. Other

102
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

parameters were chosen as the default ones. For this According to the value for different models plotted in the
configuration, our model was able to predict the waste image above, it was discovered that CNN had the best
materials with 65% accuracy. among all with an accuracy of 90%. Again, SVM calculation
D. CNN likewise demonstrated an exactness of 85% which is
For CNN implementation, we first extracted our images exceptionally near the precision of CNN. But nearly the
from the zip file and then divided the images into classes. accuracy of Random Forest and Decision Tree is not
Then we have split the images into the train, test, and sufficient. They have demonstrated an accuracy of 55% and
validation set. After that, we have visualized the dataset and 65% individually.
create our CNN model. We have used Resnet34. It is known B. Precision, Recall & F1-Score
as a residual neural network which has a lot of layer inside it.
It is already pre-trained in ImageNet Database. A pre-trained True positives and true negatives show the perceptions
CNN performs better on new image datasets. Then we have that are accurately predicted and that is why they are
selected the best parameter for our model using marked in red. The false-negative and false-positive have
learn.lr_find and it gave us the perfect learning rate to the opposite so they are marked in red. We want to limit
reduce the error rate. With the learning rate, we then false positives and false negatives. The evaluation matrix
trained our model. After training, we have visualized the formula is shown in Fig.2.These terms are somewhat
mostly incorrect images that my model was not able to confounding. So how about we take each term individually
perform well. It is because the photos received too much and comprehend it completely.
exposure or something, and this is not the fault of the model.
Then we have used the confusion matrix to find our
accuracy of the model, and we have found that our model is
sometimes confused between glass and plastic, glass, and
metal. Then we have predicted our model based on the
actual images and observe that our model can successfully
predict based on the actual images. We have ended up
achieving an accuracy of 90%.

VI. RESULT ANALYSIS Fig. 2 Evaluation Matrix

Random Forest advantage points include:


A. Accuracy
Accuracy is the most important part of the measurement  True Positive (TP):
feature. As we have done the confusion matrix in our True positives mean proper prediction in the result.
algorithms. That is why our accuracy measurement has been Before start modelling the value of the actual class is
done by a confusion matrix. The accuracy comparison found yes and after the modelling, we predicted the class is
in our experiment is shown in Fig.1, where it shows that CNN yes. E.g., if the actual class predicts the image is
and SVM achieved an accuracy of 90% and 85% respectively belong to the paper class and after prediction, we
where random forest and decision tree shows only 55% and have found that the class is paper, then we can
65%. consider it as true positive.
 True Negative (TN):
True negative also indicates proper prediction but
on the negative side. That means the actual value is
no and our predicting model also predicts the class as
a negative value. Then we consider it True negative.
E.g., if the actual class predicts the image is not a
metal class and after prediction, we have found that
the class is not metal then it is known as true negative.
False-positive and false negatives, these qualities
happen when your real class clashes with the
anticipated class.
 False Positives (FP):
False-positive occurs when the actual class is no but
the model predicts it as a yes. E.g. if the actual class
value predicts that the image does not belong to the
Fig. 1 Accuracy Comparison

103
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

paper class, but the predicted model shows that the TABLE III
RECALL TABLE
image belongs to the paper class.
 False Negative (FN): cardb glass metal paper plastic trash
False Negative occurs when the actual class is yes, oard
but the model predicts it as a no. E.g. if the actual SVM 0.81 0.8 0.85 0.6 0.82 0.83
class value predicts that the image belongs to the Random 0.54 0.38 0.67 0.64 0.54 0.46
paper class but our predicted mode; shows that the forest
image does not belong to that specific class. Decision 0.58 0.52 0.72 0.81 0.65 0.52
tree
C. Precision CNN 0.88 0.83 0.86 0.93 0.89 0.74
If we divide the value of actual positives by the sum of
true positives and false, positives then we find the precision.
The precision comparisons found in our experiment is stated
in Fig.3. The Precision scores for different algorithms are
mentioned in Table 1 below.
 Precision = actual positives / (true positives + false
positives)
TABLE I
PRECISION TABLE

cardboard glass metal paper plastic trash


SVM 0.87 0.8 0.79 0.6 0.87 0.7

Random 0.62 0.44 0.45 0.64 0.58 0.61


forest
Decision 0.63 0.65 0.54 0.81 0.6 0.58 Fig. 4 Recall Comparison
tree
CNN 0.98 0.8 0.86 0.9 0.91 0.63 E. F1-Score
F1-Score = (2* Precision * Recall) / (Precision +Recall)
The F1-Score comparisons found in our experiment is
stated in Fig.5. The scores for different algorithms are
mentioned in Table 3 below.
TABLE IIIII
F1-SCORE TABLE

card glas metal paper plast trash


boar s ic
d
SVM 0.88 0.84 0.8 0.75 0.9 0.78

Random 0.61 0.48 0.41 0.66 0.56 0.52


forest
Decision 0.71 0.61 0.53 0.76 0.62 0.55
tree
CNN 0.92 0.86 0.84 0.91 0.9 0.68

Fig. 3 Precision Comparison

D. Recall

 Recall = True positive/ (true positives + false


negatives)
The recall comparisons found in our experiment is stated
in Fig.4. The Recall scores for different algorithms are
mentioned in Table 2 below.
Fig. 5 F1-Score Comparison

104
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

F. Confusion Matrix
The results of confusion matrixes found in our
experiment, using four different algorithms are stated
consecutively in Fig.6, Fig.7, Fig.8, and Fig.9.

Fig. 9 Confusion Matrix for SVM after tuning

Fig. 6 Confusion Matrix for Random Forest after tuning


As indicated in the figures depicted above, CNN has
shown a lesser amount of waste misclassification among all
the experimented algorithms conducted in this research.

VII. CONCLUSIONS
As indicated by the survey directed and the outcomes
assembled, it is very well observed that a CNN system can
surpass the presentation of pretty much every model
constructed in this research. Boosting any count and
receiving it with Cross-Validation plans with various folds,
the introduction of any model can be raised. After building
the best model for each algorithm using the
hyperparameter tuning, CNN has come up with the best
accuracy while SVM is slightly behind. After seeing the
accuracy of the Random forest and decision tree, it is clearly
shown that they have not performed properly in classifying
the waste images properly.
Fig. 7 Confusion Matrix for Decision Tree
ACKNOWLEDGMENT
The authors are grateful to Kulliyyah of Information and
Communication Technology, International Islamic University
Malaysia for their assistance and guidelines.

REFERENCES
[1] Z. Lenkiewicz, “Waste and the Sustainable Development Goals.”
Retrieved from Wasteaid: https://wasteaid. org. uk/waste-
sustainable …, 2018.
[2] O. Adedeji and Z. Wang, “Intelligent waste classification system using
deep learning convolutional neural network,” Procedia Manuf., vol.
35, pp. 607–612, 2019.
[3] M. Pamintuan, S. M. Mantiquilla, H. Reyes, and M. J. Samonte, “i-BIN:
An Intelligent Trash Bin for Automatic Waste Segregation and
Monitoring System,” in 2019 IEEE 11th International Conference on
Humanoid, Nanotechnology, Information Technology, Communication
and Control, Environment, and Management (HNICEM), pp. 1–5.
[4] A. Silva and E. Soares, “Artificial intelligence in automated sorting in
trash recycling,” XV Encontro Nac. Inteligência Artif. e Comput., 2018.
Fig. 8 Confusion Matrix for CNN [5] X. Xu, X. Qi, and X. Diao, “Reach on Waste Classification and

105
International Journal on Perceptive and Cognitive Computing (IJPCC) Vol 6, Issue 2 (2020)

Identification by Transfer Learning and Lightweight Neural Network,”


2020. [12] R. S. S. Devi, V. R. Vijaykumar, and M. Muthumeena, “Waste
[6] Z. Oralhan, B. Oralhan, and Y. Yiğit, “Smart city application: Internet Segregation using Deep Learning Algorithm.”
of things (IoT) technologies based smart waste collection using data [13] Y. Chu, C. Huang, X. Xie, B. Tan, S. Kamal, and X. Xiong, “Multilayer
mining approach and ant colony optimization,” Internet Things, vol. hybrid deep-learning method for waste classification and recycling,”
14, no. 4, p. 5, 2017. Comput. Intell. Neurosci., vol. 2018, 2018.
[7] P. Cp et al., “ICACCI-02 (A): Artificial Intelligence and Machine [14] Y. Zhao and Y. Zhang, “Comparison of decision tree methods for
Learning/Data Engineering/Biocomputing (Regular Papers).” finding active objects,” Adv. Sp. Res., vol. 41, no. 12, pp. 1955–1959,
[8] G. E. Sakr, M. Mokbel, A. Darwich, M. N. Khneisser, and A. Hadi, 2008.
“Comparing deep learning and support vector machines for [15] A. Bosch, A. Zisserman, and X. Munoz, “Image classification using
autonomous waste sorting,” in 2016 IEEE International random forests and ferns,” in 2007 IEEE 11th international conference
Multidisciplinary Conference on Engineering Technology (IMCET), 2016, on computer vision, 2007, pp. 1–8.
pp. 207–212. [16] M. Yang and G. Thung, “Classification of trash for recyclability status,”
[9] G. Mittal, K. B. Yagnik, M. Garg, and N. C. Krishnan, “Spotgarbage: CS229 Proj. Rep., vol. 2016, 2016.
smartphone app to detect garbage using deep learning,” in [17] C. Agarwal and A. Sharma, “Image understanding using decision tree
Proceedings of the 2016 ACM International Joint Conference on based machine learning,” in ICIMU 2011: Proceedings of the 5th
Pervasive and Ubiquitous Computing, 2016, pp. 940–945. international Conference on Information Technology & Multimedia,
[10] I. F. Hanbal, J. S. Ingosan, N. A. A. Oyam, and Y. Hu, “Classifying 2011, pp. 1–8.
Wastes Using Random Forests, Gaussian Naïve Bayes, Support [18] C. Cortes, “WSupport-vector network,” Mach. Learn., vol. 20, pp. 1–
Vector Machine and Multilayer Perceptron,” in IOP Conference Series: 25, 1995.
Materials Science and Engineering, 2020, vol. 803, no. 1, p. 12017. [19] E. A. Bender, “Mathematical methods in artificial intelligence,” 1996.
[11] N. S. Gupta, V. Deepthi, M. Kunnath, P. S. Rejeth, T. S. Badsha, and B. [20] K. Millard and M. Richardson, “On the importance of training data
C. Nikhil, “Automatic Waste Segregation,” in 2018 Second sample selection in random forest image classification: A case study
International Conference on Intelligent Computing and Control Systems in peatland ecosystem mapping,” Remote Sens., vol. 7, no. 7, pp.
(ICICCS), 2018, pp. 1688–1692. 8489–8515, 2015.

106

You might also like