0% found this document useful (0 votes)
1 views

Final Report on Classification and Separation of Solid Waste using Deep Learning

This dissertation presents a project on the classification and separation of solid waste using deep learning techniques, specifically focusing on the implementation of ResNet and VGG architectures. The study aims to develop an efficient image classification system that categorizes waste into organic and inorganic components, achieving high accuracy through rigorous evaluation of various models. The project highlights the importance of accurate waste classification for improving waste management practices and promoting environmental sustainability.

Uploaded by

samiksha.code24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Final Report on Classification and Separation of Solid Waste using Deep Learning

This dissertation presents a project on the classification and separation of solid waste using deep learning techniques, specifically focusing on the implementation of ResNet and VGG architectures. The study aims to develop an efficient image classification system that categorizes waste into organic and inorganic components, achieving high accuracy through rigorous evaluation of various models. The project highlights the importance of accurate waste classification for improving waste management practices and promoting environmental sustainability.

Uploaded by

samiksha.code24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Classification and Separation of Solid

Waste Using Deep Learning


Dissertation submitted to
Shri Ramdeobaba College of Engineering & Management, Nagpur
in partial fulfillment of the requirement for the award of
degree of

BACHELOR OF TECHNOLOGY
In

COMPUTER SCIENCE AND ENGINEERING


By

Juhie Sayyed (28)


Ajay Kumar (33)
Vedant Khergade (70)
Rahul Baser (75)

Guide

Prof. D. A. Borikar

Department of Computer Science and Engineering


Shri Ramdeobaba College of Engineering & Management, Nagpur
440013
(An Autonomous Institute affiliated to Rashtrasant Tukadoji Maharaj Nagpur University Nagpur)

April 2024
SHRI RAMDEOBABA COLLEGE OF ENGINEERING &
MANAGEMENT, NAGPUR
(An Autonomous Institute affiliated to Rashtrasant Tukadoji Maharaj Nagpur University Nagpur)

Department of Computer Science and Engineering

CERTIFICATE
This is to certify that the Thesis on “Classification and Separation of Solid Waste
using Deep Learning” is a bonafide work of Juhie Sayyed, Ajay Kumar, Vedant
Khergade and Rahul Baser submitted to the Rashtrasant Tukadoji Maharaj Nagpur
University, Nagpur in partial fulfillment of the award of a Degree of Bachelor of
Technology. It has been carried out at the Department of Computer Science and
Engineering, Shri Ramdeobaba College of Engineering and Management, Nagpur during
the academic year 2023-2024.

Date: 13/04/2024

Place: Nagpur

Prof. D. A. Borikar Dr. Ramchand Hablani


Project Guide H.O.D
Department of Computer Department of Computer
Science and Engineering Science and Engineering

Dr. R. S. Pande
Principal
DECLARATION

I, hereby declare that the thesis titled “Classification and Separation of Solid Waste
using Deep Learning” submitted herein, has been carried out in the Department of
Computer Science and Engineering of Shri Ramdeobaba College of Engineering &
Management, Nagpur. The work is original and has not been submitted earlier as a
whole or part for the award of any degree/diploma at this or any other institution /
University

Date: 13/04/2024

Place: Nagpur

Name of the Student Roll No. Signature

Juhie Sayyed 28

Ajay Kumar 33

Vedant Khergade 70

Rahul Baser 75
APPROVAL SHEET

This report entitled

“Classification and Separation of Solid Waste using Deep


Learning”
By
Juhie Sayyed
Ajay Kumar
Vedant Khergade
Rahul Baser
is approved for the degree of Bachelor of Technology

————————— —————————
Prof. D. A. Borikar Name & Signature
(Project Guide) (External Examiner)

————————
Dr. R. Hablani
(H.O.D, CSE)

Date: 13/04/2024

Place: Nagpur
ACKNOWLEDGEMENT

The project is a combined effort of a group of individuals who synergize to contribute


towards the desired objectives. Apart from the efforts by us, the success of the project
shares an equal proportion on the engagement and guidance of many others. We take this
opportunity to express our gratitude to the people who have been instrumental in the
successful completion of this project.

We take the opportunity to express our deep thanks to our project guide Prof. D. A.
Borikar for providing timely assistance to our queries and guidance that he gave owing to
his experience in this field for the past many years. He had indeed been a lighthouse of
the journey.

We would like to express our deepest gratitude to Dr. Ramchand Hablani, Head,
Department of Computer Science and Engineering, RCOEM, Nagpur for providing us the
opportunity to embark on this project.

We would like to express our deepest gratitude to Dr. Rajesh Pande, Principal, RCOEM,
Nagpur for providing us the opportunity to embark on this project.

Finally, we extend our gratitude to all the faculty members of the CSE department who
have always been so supportive and providing resources needed in our project
development. We are very grateful to all of them who have unconditionally supported us
throughout the project.

Date: 13/04/2024

ii
ABSTRACT

The escalating global issue of solid waste management poses severe environmental and
health risks, exacerbated by the rapidly increasing volume of waste generated worldwide.
Improper disposal and inadequate segregation of waste materials contribute significantly
to pollution, resource depletion, and ecological degradation. This project aims to develop
an efficient image classification system for solid waste management, addressing the
critical challenge of accurately categorizing waste into organic and inorganic
components, and further classifying inorganic waste into nine distinct classes, including
aluminium, glass, paper, wood, textiles, and plastic.

The methodology involves leveraging the power of deep learning algorithms, specifically
the ResNet and VGG architectures, which are widely acclaimed for their exceptional
performance in computer vision tasks. The approach employed a comprehensive
evaluation of four state-of-the-art models: ResNet152, ResNet50, VGG16, and VGG19.
These models were rigorously trained and evaluated using a diverse dataset of waste
images. The key findings revealed that the VGG19 model outperformed the others,
achieving the highest classification accuracy, closely followed by the ResNet152 model.
Consequently, these two models were selected for integration into the final waste
classification system.

To facilitate user interaction and practical application, a user-friendly interface was


developed, enabling users to upload or capture images of waste for classification using
either the ResNet or VGG model.

Keywords: Waste classification, ResNet, VGG, Image classification, Deep learning,


Organic waste and inorganic waste.

iii
TABLE OF CONTENTS

Contents Page No.


Acknowledgment ii
Abstract iii
List of Figures v
List of Tables vi
List of Abbreviations vii
CHAPTER 1: INTRODUCTION 1-3
1.1 Problem Definition 1
1.2 Motivation 1
1.3 Overview 2
1.4 Objectives 3
1.5 Applications 3
CHAPTER 2: LITERATURE SURVEY 4-6
CHAPTER 3: METHODOLOGY 7 - 13
3.1 Proposed Methodology 7
3.2 Model Approach 9
3.3 Technology Stack 14
CHAPTER 4: IMPLEMENTATION 15 - 18
4.1 Data Collection and Preparation 15
4.2 Parameter Configuration and Data Augmentation 16
4.3 Training Procedure 17
CHAPTER 5: RESULTS AND DISCUSSION 19 - 26
5.1 Test Results 23
CHAPTER 6: CONCLUSION AND FUTURE SCOPE 27 - 28
REFERENCES 29 - 30
iv
LIST OF FIGURES

Fig No. Figure Caption Page No.

Fig. 3.1 System Architecture 8

Fig. 3.2 VGG Architecture 9

Fig. 3.3 Comparison of 20-layer vs 56-layer architecture 11

Fig. 4.1 Dataset 15

Fig. 4.2 Implementation flow diagram 18

Fig. 5.1 Model Accuracy on Different Waste Types 23

Fig. 5.2 Wood, Organic, Paper and Cardboard and Textiles Classification 24

Fig. 5.3 Glass, Aluminium, Plastic and Other Plastic Classification 24

Fig. 5.4 Interface for Solid Waste Classification 25

Fig. 5.5 Upload Vegetable Image 25

Fig. 5.6 Upload Soda Can Image 26

Fig. 5.7 Capture Image 26

v
LIST OF TABLES

Table No. Table Caption Page No.

Table 5.1 ResNet50 Evaluation Matrix 20

Table 5.2 ResNet152 Evaluation Matrix 20

Table 5.3 VGG16 Evaluation Matrix 21

Table 5.4 VGG19 Evaluation Matrix 21

Table 5.5 Model Performance 22

vi
LIST OF ABBREVIATIONS

Abbreviation Expansion

ResNet50 Residual Network 50

ResNet152 Residual Network 152

VGG16 Visual Geometry Group 16

VGG19 Visual Geometry Group 19

CNN Convolutional Neural Network

GPS Global Positioning System

ML Machine Learning

AI Artificial Intelligence

MSW Municipal Solid Waste

ReLu Rectified Linear Unit

vii
CHAPTER 1

INTRODUCTION
The escalating global issue of solid waste management has emerged as a pressing
environmental and public health concern. The rapid urbanization and industrialization
coupled with unsustainable consumption patterns have led to an unprecedented surge in
waste generation worldwide. Improper disposal and inadequate segregation of waste
materials contribute significantly to pollution, resource depletion, and ecological
degradation, posing severe risks to environmental sustainability and human well-being.

Existing literature and research efforts have explored various approaches to tackle this
challenge, including traditional waste management techniques, recycling initiatives, and
public awareness campaigns. However, the accurate classification and segregation of
waste remain a critical bottleneck, hindering effective waste management and recycling
processes.

1.1 Problem Definition

Despite existing efforts and approaches, such as traditional waste management


techniques, recycling initiatives, and public awareness campaigns, the accurate
classification and segregation of waste remain a significant bottleneck. Manual sorting
and classification methods are often labor-intensive, time-consuming, and prone to errors,
hindering effective waste management and recycling processes. This highlights the need
for more efficient and automated solutions to address the challenges posed by the
ever-increasing volume of waste.

1.2 Motivation

Driven by the urgent necessity to address this global issue, this project aims to develop an
intelligent image classification system for solid waste management. By harnessing the
power of deep learning algorithms and computer vision techniques, the project seeks to
provide a reliable and efficient means of waste classification. The primary objective is to
accurately classify waste into organic and inorganic components, and further categorize

1
inorganic waste into nine distinct classes, including aluminum, glass, paper, wood,
textiles, and plastic. By providing a reliable and efficient means of waste classification,
this system can significantly contribute to improving waste management practices,
promoting effective recycling, and minimizing environmental impact.

By addressing the critical challenge of accurate waste classification, this project has the
potential to contribute significantly to environmental sustainability, resource
conservation, and the development of a circular economy, ultimately benefiting both
communities and the planet.

1.3 Overview

This project leverages cutting-edge deep learning architectures, specifically the ResNet
and VGG models, which have demonstrated exceptional performance in computer vision
tasks. A comprehensive evaluation of four models was conducted using a diverse dataset
of waste images. To facilitate user interaction and practical application, a user-friendly
interface has been developed, enabling users to upload or capture images of waste for
classification using either the ResNet or VGG model. The system's ability to accurately
categorize waste into organic and inorganic components, and further classify waste into
specific material types, holds significant implications for streamlining waste management
processes, promoting effective recycling, and contributing to a more sustainable future.

The accurate classification of waste into organic and inorganic components, and further
segregation of waste into specific material types, has far-reaching implications. It can
greatly enhance waste management practices, minimize environmental impact, and foster
a more sustainable future. Potential applications of this system include integration into
waste management facilities, recycling centers, municipal waste collection efforts, and
public awareness and education campaigns.

2
1.4 Objectives

The following are the objectives of our project:

I. To study the current methodologies for waste separation.


II. To design a highly accurate Deep Learning model capable of classifying diverse
categories of solid waste.
III. To find ways to implement the new methodology on current conveyor belt.
IV. To test and analyze the developed method for system monitoring, performance
and analysis.

1.5 Applications

I. Waste management facilities: The system can be integrated into waste


management facilities to automate the sorting and classification process, reducing
manual labor and increasing efficiency.
II. Recycling centers: Accurate classification of waste materials can facilitate
effective recycling processes, ensuring that materials are properly segregated and
processed for recycling.
III. Municipal waste collection: The system can be employed in municipal waste
collection efforts, enabling on-site classification and segregation of waste, thereby
improving waste management practices at the local level.
IV. Public awareness and education: The system can be utilized as an educational tool
to raise awareness about waste segregation and promote sustainable waste
management practices among the general public.

3
CHAPTER 2

LITERATURE SURVEY
For the purpose of this study, various research papers are referred to that suggest the
numerous analyses and thinking of the varied parameters of the project and additionally
the extent of the project.

The authors [1] introduced a two-stage deep learning framework for garbage
classification achieving up to 75% accuracy. The first stage, utilizing EfficientDet-D2,
localizes litter without specifying its class. The second stage classifies identified waste
into seven categories using semi-supervised training with unlabeled images. Their
approach proposes a mobile application leveraging deep learning for precise waste
categorization.

The model discussed in [2] utilizes the TrashNet dataset for waste image classification. It
introduces a simple yet efficient waste classification method employing a multilayer
hybrid convolutional neural network, achieving up to 92% accuracy. The model
undergoes four successive improvements to enhance classification performance. The
study includes heat map comparisons for feature extraction and evaluates the proposed
scheme against existing methods based on accuracy, parameters, and complexity.The
authors [3] proposed a deep learning model integrated with IoT-based smart bins for
real-time waste sorting. Using a CNN, waste is classified into digestible and indigestible
categories, achieving up to 95% accuracy for indigestible items across six categories. The
study outlines the smart bin's operation and suggests improving accuracy by
incorporating various sensor types.

The author [4] proposes an ML- and IoT-based waste management system aiming for a
pollution-free environment. It utilizes a hardware prototype with GPS tracking to
automate waste management tasks, focusing on collection optimization and minimizing

4
costs. The prototype, equipped with an Arduino UNO microcontroller and sensors,
monitors waste levels and moisture status. Efficiency is enhanced through smart bins,
route optimization, and automated collection orders. In [5], a smart waste prediction
system is introduced, utilizing CNN and an airjet structure for data preprocessing. The
technique efficiently detects waste categories with high accuracy, targeting waste
management in Dehradun, India. The model integrates CNN and decision-tree algorithms
for automatic waste identification, minimizing pollution and disease risks with limited
human intervention.

In [6], a smart bin system for waste localization and segregation using IoT and ML
techniques is proposed. It employs a K-Nearest Neighbor (KNN) model for waste
classification, achieving 93.3% accuracy.In [7], a low-cost waste management scheme for
smart bins is introduced. It utilizes logical regression and graph theory for real-time
monitoring and route optimization. Tested on the campus of Ton Duc Tang University
(Vietnam), the system proved simple, cost-effective, and efficient, leading to full-campus
deployment.

[10] According to the Pollution Control Department, Thailand produced 27.82 million
tons of Municipal Solid Waste (MSW) in 2018 which was 1.64% higher than the previous
year. 34% of municipal solid wastes were segregated at their sources and
re-utilized.These four waste types are general waste, compostable waste, recyclable waste
and hazardous waste [11]. In a four-bin system, waste bins come in four different colors.
Blue bins are for general wastes. Green bins are for compostable wastes. Yellow bins are
for recyclable wastes. Red bins are for hazardous wastes. However, it is quite common to
find only general-waste and recyclable-waste bins at public places like bus stops, parks
and shopping malls. In that situation, recyclable items should go in recyclable-waste bin
while all other items go in general-waste bin.Waste segregation can be more difficult than
it sounds. At present, public places provide waste bins labeled for segregation and end up

5
with mixed wastes in every bin. At Wongpanit, Thailand’s biggest full-loop recycling
facility, solid wastes are segregated mainly by human [12].

Convolutional Neural Networks (ConvNet or CNN) have been around for computer
vision problems such as object detection, object segmentation, motion tracking, object
recognition, object classification and semantic segmentation. Reference [13] found that
classification performance was significantly improved when CNN models were
employed to classify 1.2 million images in ImageNet dataset. There are a number of CNN
architectures pre-trained on ImageNet dataset. Reference [14] studied an optimization of
deep residual networks for images recognition. ImageNet and CIFAR-10 datasets were
used in their study. CNN architectures from the ResNet family were taken into
consideration.

The following research works are related to using CNN models to classify waste images.
Reference [15] compared two waste classification models: CNN AlexNet and support
vector
machine (SVM). Waste images were to be sorted into three classes: plastic, paper and
metal. SVM classifier could reach 94.8% accuracy while CNN classifier achieved only
83%. A deep neural network classification model called “RecycleNet” was proposed in
[16]. Reference [17] used an OverFeat-GoogLeNet model to localize and classify wastes
on streets. Waste images were collected by a high- resolution camera attached to a vehicle
running on streets. Most of wastes found were leaves and cigarette butts.

Reference [18] compared waste classification performance of CNN-based (VGG-16 and


AlexNet) and traditional machine learning classifiers (KNN, SVM and RF). CNN-based
classifiers outperformed traditional ones. The highest accuracy achieved was 93% from
VGG-16 model. Trashnet dataset was used in their experiments. Reference [19] proposed
a multilayer hybrid deep-learning system that could determine whether a certain waste
was recyclable. AlexNet together with multilayer perceptrons were employed in their
system.

6
CHAPTER 3

PROPOSED METHODOLOGY
3.1 Proposed Methodology

The proposed methodology for the solid waste classification system involves a
multi-stage process that combines deep learning techniques and computer vision
algorithms. The overall approach can be divided into the following key stages:

1. Data Acquisition and Preprocessing: Collect a diverse dataset of waste images,


including organic and inorganic waste materials, from Kaggle. Preprocess the
images by resizing, normalization, and data augmentation techniques (e.g.,
rotation, flipping, and cropping) to increase the dataset's diversity and improve
model generalization.

2. Model Selection and Training: Select state-of-the-art deep learning architectures


known for their exceptional performance in computer vision tasks, such as ResNet
and VGG models. Employ transfer learning techniques by utilizing pre-trained
models on large-scale datasets (e.g., ImageNet) as the starting point for model
training. Fine-tune the pre-trained models on the waste image dataset, adjusting
the final layers to suit the specific classification task. Utilize appropriate loss
functions (e.g., cross-entropy loss) and optimization algorithms (e.g., Adam
optimizer) to train the models effectively. Implement techniques such as early
stopping and learning rate scheduling to prevent overfitting and improve model
performance.

3. Model Evaluation and Selection: Divide the dataset into training, validation, and
testing subsets for proper model evaluation. Evaluate the performance of the
trained models using appropriate metrics, such as classification accuracy,
precision, recall, and F1-score. Compare the performance of different models
(e.g., ResNet152, ResNet50, VGG16, and VGG19) on the validation and testing

7
datasets. Select the top-performing models based on their classification accuracy
and computational efficiency for integration into the final system.
4. User Interface Development: Design and develop a user-friendly interface that
allows users to upload or capture images of waste materials. Integrate the best
deep learning models into the interface for waste classification. Display the
classification results, indicating whether the waste is organic or inorganic, and if
then the specific material category (e.g., aluminium, glass, plastic).

5. System Deployment and Testing: Conduct extensive testing with real-world


waste images to evaluate the system's performance and identify potential areas for
improvement. Continuously update and refine the system by incorporating
feedback from users and incorporating new data sources to improve classification
accuracy.

The proposed methodology leverages the strengths of deep learning and computer vision
techniques to address the critical challenge of accurate waste classification. By
combining state-of-the-art models, comprehensive data preprocessing, and a user-friendly
interface, the system aims to provide an efficient and practical solution for solid waste
management, contributing to environmental sustainability and promoting effective
recycling practices.

Fig. 3.1: System Architecture

8
3.2 Modeling Approach:

The modeling approach employed in this project focuses on leveraging the power of deep
learning architectures, specifically the ResNet and VGG models, for accurate solid waste
classification. These models have demonstrated exceptional performance in various
computer vision tasks, making them well-suited for the waste classification problem. The
modeling approach can be described as follows:

1. Model Architecture Selection

● VGG (Visual Geometry Group)

It is a standard deep Convolutional Neural Network (CNN) architecture with


multiple layers. The deep refers to the number of layers with VGG-16 or VGG-19
consisting of 16 and 19 convolutional layers. The VGG architecture is the basis of
ground-breaking object recognition models. Developed as a deep neural network,
the VGGNet also surpasses baselines on many tasks and datasets beyond
ImageNet. Moreover, it is now still one of the most popular image recognition
architectures.

Fig. 3.2: VGG Architecture[8]

9
The VGG network is constructed with very small convolutional filters. The
VGG-16 consists of 13 convolutional layers and three fully connected layers.
Let’s take a brief look at the architecture of VGG:

Input: The VGGNet takes in an image input size of 224×224. For the ImageNet
competition, the creators of the model cropped out the center 224×224 patch in
each image to keep the input size of the image consistent.

Convolutional Layers: VGG’s convolutional layers leverage a minimal receptive


field, i.e., 3×3, the smallest possible size that still captures up/down and left/right.
Moreover, there are also 1×1 convolution filters acting as a linear transformation
of the input. This is followed by a ReLU unit, which is a huge innovation from
AlexNet that reduces training time. ReLU stands for rectified linear unit
activation function; it is a piecewise linear function that will output the input if
positive; otherwise, the output is zero. The convolution stride is fixed at 1 pixel to
keep the spatial resolution preserved after convolution (stride is the number of
pixel shifts over the input matrix).

Hidden Layers: All the hidden layers in the VGG network use ReLU. VGG does
not usually leverage Local Response Normalization (LRN) as it increases memory
consumption and training time. Moreover, it makes no improvements to overall
accuracy.
Fully-Connected Layers: The VGGNet has three fully connected layers. Out of
the three layers, the first two have 4096 channels each, and the third has 1000
channels, 1 for each class.

Two variants, VGG16 and VGG19, are explored in this project, with the latter
being deeper and potentially more accurate.

● ResNet (Residual Network)

After the first CNN-based architecture (AlexNet) that wins the ImageNet 2012
competition, Every subsequent winning architecture uses more layers in a deep
neural network to reduce the error rate. This works for less number of layers, but

10
when the number of layers increase, there is a common problem in deep learning
associated with that called the Vanishing/Exploding gradient.

This causes the gradient to become 0 or too large. Thus when increase number of
layers, the training and test error rate also increases.

Fig. 3.3: Comparison of 20-layer vs 56-layer architecture[9]

In the above plot, it can be observed that a 56-layer CNN gives more error rate on
both training and testing datasets than a 20-layer CNN architecture. After
analyzing more on error rates the authors were able to conclude that it is caused
by vanishing/exploding gradient.

ResNet, which was proposed in 2015 by researchers at Microsoft Research


introduced a new architecture called Residual Network.

The advantage of adding this type of skip connection is that if any layer hurt the
performance of architecture then it will be skipped by regularization. So, this
results in training a very deep neural network without the problems caused by
vanishing/exploding gradient.

Two variants, ResNet152 and ResNet50, are considered in this project, with the
former being deeper and potentially more accurate, while the latter strikes a
balance between accuracy and computational efficiency.

● Both VGG and ResNet are powerful tools for image classification, including solid
waste classification. However, they have some key differences:

11
● Depth: VGG-16 has 16 layers and VGG-19 has 19 layers, while ResNet
can have much deeper architectures, like ResNet-50 and ResNet-152.
● Skip Connections: ResNet introduced the concept of skip connections,
which allows the network to skip layers and helps in solving the
vanishing/exploding gradient problem. VGG does not have this feature.

● Performance: Both networks have shown good performance in solid


waste classification. However, the best model may depend on the specific
task and the data available.

2. Transfer Learning:

● To leverage the knowledge gained from training on large-scale datasets, transfer


learning is employed by utilizing pre-trained models on datasets like ImageNet as
the starting point.

● The pre-trained models are fine-tuned on the waste image dataset, allowing the
models to adapt their feature representations to the specific waste classification
task.

3. Model Customization:

● The final layers of the pre-trained models are customized to suit the waste
classification task.

● For the multi-class classification task (nine waste classes), multiple output nodes
with a softmax activation function are employed, representing each waste
category.

4. Loss Function and Optimization:

● Cross-entropy loss is commonly used as the loss function for both binary and
multi-class classification tasks.

● Optimization algorithms like Adam are employed to minimize the loss function
and update the model's weights during training.

12
5. Regularization and Hyperparameter Tuning:

● Techniques like dropout, early stopping, and learning rate scheduling are
implemented to prevent overfitting and improve model generalization.

● Hyperparameters, such as learning rate, batch size, and regularization strength, are
tuned through experimentation and validation to achieve optimal model
performance.

6. Model Evaluation:
● The trained models are evaluated on a same test dataset, which was not used
during training or validation.

● Appropriate evaluation metrics, such as accuracy, precision, recall, and F1-score,


are computed to assess the models' performance.

● The top-performing models, based on their classification accuracy and


computational efficiency, are selected for integration into the final waste
classification system.

The modeling approach leverages the strengths of deep learning architectures, transfer
learning, and appropriate customization and optimization techniques to tackle the solid
waste classification problem effectively. By evaluating multiple models and selecting the
top performers, the system aims to provide accurate and reliable waste classification
results, contributing to improved waste management and recycling practices.

13
3.3 Technology Stack

Python: It is used as a programming language for the model.

ResNet and VGG: These are CNN-based waste image classification


models which are going to be used.

Kaggle: It is used for gaining the dataset for the project.

Flask: It is used for developing the website.

HTML, CSS and JavaScript: It is used for designing the webpage.

14
CHAPTER 4

IMPLEMENTATION

4.1 Data Collection and Preparation

For data collection and preparation, the extensive dataset was obtained from the "Kaggle
waste classification data,"[20] which encompasses nine distinct classes of solid waste:
aluminum, glass, cardboard and paper, cartons, plastic, wood, textile, and organic solid.
The dataset is structured in the directory "WasteImagesDataset/".

Dataset Characteristics:

● This dataset contains 5621 images of different types of waste.


● Average Images in each class: 620 Images
● Colored Image
● Average Dimension: 224 x 224 pixels
● Average Size: 41 kb
● Overall Size: 210 Mb

Fig. 4.1: Dataset

15
To facilitate model training, the dataset was split into training and validation subsets
using a validation split of 0.1 means 90% for training and 10% dataset for validation. The
TensorFlow Keras utility function `image_dataset_from_directory()` was utilized for this
purpose. For both training and validation subsets, a batch size of 16 was chosen for
efficient processing. Additionally, images were intelligently resized during loading using
the `smart_resize` parameter.

After loading the data, the class names were extracted from the training dataset and
stored for reference. Furthermore, the number of classes in the dataset was determined to
be nine. To optimize data loading performance, prefetching was applied using the
`prefetch()` method with an `AUTOTUNE` buffer size.

In total, the dataset comprises 5621 images across the nine classes, which will serve as
the foundation for training and evaluating the waste classification model.

4.2 Parameter Configuration and Data Augmentation

The deep learning models for waste object classification were meticulously configured
using TensorFlow, NumPy, Matplotlib, and OpenCV. The dataset, containing waste item
images categorized into distinct classes, resided in the "WasteImagesDataset" directory.
Utilizing the `image_dataset_from_directory` function, it was efficiently split into
training and testing subsets, with a 10% validation split. Training data underwent
preprocessing, including resizing and batching (batch size: 16), and diverse data
augmentation techniques such as rescaling and random flips were applied via
TensorFlow's Sequential API. Pre-trained models from the ImageNet dataset were
employed as feature extractors, with frozen layers and additional fully connected layers
appended for classification. Key hyperparameters like the learning rate (0.0001) and
optimizer (Adam) were carefully configured for effective training. The choice of sparse
categorical cross-entropy loss function further optimized model training. This
comprehensive approach laid a solid foundation for successful waste classification,
enhancing model generalization and robustness.

16
4.3 Training Procedure

For training the model on the solid waste classification task, follow a systematic approach
to optimize performance and resource utilization. Initialize the training environment by
configuring the data pipeline, and splitting the dataset into training and validation sets
with a 90-10 split. Preprocess the input images using data augmentation techniques such
as rescaling, random flipping, and random rotation to improve model robustness and
generalization. The pre-trained model architecture, pre-trained on ImageNet, is utilized as
the base model for feature extraction, with the final classification layers customized for
our task. Freeze the weights of the pre-trained layers to prevent overfitting and facilitate
faster convergence.

Employ the Adam optimizer with a learning rate of 0.0001 to optimize model parameters
during training. The sparse categorical cross-entropy loss function is chosen as it is
suitable for multi-class classification tasks, providing a measure of the discrepancy
between predicted and true class labels. The model's performance is evaluated based on
accuracy metrics during both training and validation.

Training is conducted over 10 epochs, with early stopping applied to prevent overfitting
and improve efficiency. The model's training history, including loss and accuracy metrics,
is saved in an HDF5 file for further analysis. Additionally, callbacks are used to save the
best-performing model based on validation loss.

Finally, the trained model's performance on test images retrieved from external sources.
The model's predictions are visualized along with the corresponding confidence scores,
providing insights into its classification accuracy. This comprehensive training procedure
ensures that the model is effectively trained and evaluated for solid waste classification,
enabling it to make accurate predictions on unseen data.

17
Fig. 4.2: Implementation flow Diagram

18
CHAPTER 5

RESULT AND DISCUSSION


In this Project report, the comparative analysis of four distinct convolution neural
network (CNN) architectures—ResNet50, ResNet152, VGG16, and VGG19—on an
image classification task. These models were trained on a dataset consisting of 5621
images distributed across nine classes. Although the intended epoch assignment for
ResNet152 was 10, the training process ceased prematurely at epoch 4. Despite this,
rigorously evaluated the performance of each model based on the obtained results.
Interestingly, the training stopped at epoch 4 did not significantly impact the comparative
analysis, as the achieved accuracies were consistent with the early training stages.
Notably, VGG19 emerged with the highest accuracy of 97%, closely followed by VGG16
at 96%. In contrast, ResNet50 and ResNet152 attained accuracies of 96% and 95%,
respectively.

In analyzing the performance of the four models—ResNet50, ResNet152, VGG16, and


VGG19—on the task of image classification, several key metrics were evaluated,
including precision, recall, and F1 score. Notably, ResNet50 demonstrated a balanced
performance with a precision and recall of 0.96, alongside an F1 score of 0.96. Despite
training cessation at epoch 4, ResNet152 showcased competitive precision and recall
values of 0.95 and 0.94, respectively, yielding an F1 score of 0.95. VGG16 exhibited
similar metrics to ResNet50, maintaining a precision, recall, and F1 score of 0.96. On the
other hand, VGG19 emerged with the highest precision, recall, and F1 score, achieving
values of 0.97 across all metrics. These findings underscore the robustness of VGG19 in
making accurate predictions with minimal false positives and false negatives. Despite
slight variations in performance, all models demonstrated strong predictive capabilities,
as reflected in their high accuracy and balanced precision-recall trade-offs. These insights
offer valuable guidance for selecting and optimizing CNN architectures for image
classification tasks, with VGG19 standing out as particularly promising in achieving
superior performance across multiple evaluation metrics. For the Evaluation matrix refer
to Tables 5.1, 5.2, 5.3, and 5.4.

19
Table 5.1: ResNet50 Evaluation Matrix

Label Precision Recall F1-score Support


Aluminium 0.92 0.98 0.95 550
Cartoon 0.97 0.94 0.96 336
Glass 0.95 0.97 0.96 550
Organic Waste 1.00 1.00 1.00 210
Other Plastics 1.00 0.89 0.94 339
Paper and Cardboard 0.92 0.99 0.96 550
Plastic 0.99 0.93 0.96 493
Textiles 0.99 0.98 0.99 335
Wood 0.99 0.95 0.97 347
Accuracy 0.96 3710
Macro avg 0.97 0.96 0.96 3710
Weighted avg 0.96 0.96 0.96 3710

Table 5.2: ResNet152 Evaluation Matrix

Label Precision Recall F1-score Support


Aluminium 0.95 0.94 0.95 550
Cartoon 0.98 0.92 0.95 336
Glass 0.93 0.93 0.93 550
Organic Waste 0.99 0.97 0.98 550
Other Plastics 0.99 0.86 0.92 340
Paper and Cardboard 0.88 0.99 0.93 550
Plastic 0.93 0.95 0.94 510
Textiles 0.98 0.98 0.98 335
Wood 0.97 0.97 0.97 347
Accuracy 0.95 4068
Macro avg 0.95 0.94 0.95 4068
Weighted avg 0.95 0.95 0.95 4068

20
Table 5.3: VGG16 Evaluation Matrix

Label Precision Recall F1-score Support


Aluminium 0.97 0.97 0.97 550
Cartoon 0.98 0.98 0.98 336
Glass 0.91 0.99 0.95 550
Organic Waste 0.99 0.99 0.99 210
Other Plastics 0.99 0.95 0.97 339
Paper and Cardboard 0.94 0.97 0.96 550
Plastic 0.99 0.88 0.93 493
Textiles 0.99 0.98 0.98 335
Wood 0.96 0.96 0.96 347
Accuracy 0.96 3710
Macro avg 0.97 0.96 0.96 3710
Weighted avg 0.96 0.96 0.96 3710

Table 5.4: VGG19 Evaluation Matrix

Label Precision Recall F1-score Support


Aluminium 0.95 0.97 0.96 550
Cartoon 0.98 0.99 0.98 336
Glass 0.95 0.98 0.96 550
Organic Waste 1.00 0.98 0.99 210
Other Plastics 0.98 0.95 0.96 339
Paper and Cardboard 0.96 0.98 0.97 550
Plastic 0.98 0.92 0.95 493
Textiles 1.00 0.99 1.00 335
Wood 0.97 0.97 0.97 347
Accuracy 0.97 3710
Macro avg 0.97 0.97 0.97 3710
Weighted avg 0.97 0.97 0.97 3710

21
Calculated the model accuracy on different waste types and got some analysis that
Resnet152 performs that well as compared to other models, it gives good prediction in
Paper, Textile, and Organic waste type categories where whereas ResNet50 produces
good results in Organic, Paper, Aluminium, Textile, and Glass and it can be seen that
ResNets model does not work well for other plastic dataset as compared to VGG models.

Table 5.5: Model Performance

Model Epochs Precision accuracy Recall F1 score

ResNet50 10 97% 96% 96% 96%

ResNet152 4 95% 95% 94% 95%

VGG16 10 97% 96% 96% 96%

VGG19 10 97% 97% 97% 97%

Table 5.5 Presents a comparative analysis of the ResNet50, ResNet152, VGG16 and
VGG19 models in terms of their performance metrics, including training epochs,
precision, accuracy, recall, and F1 confidence. It illustrates the trade-offs and advantages
associated with each model.

ResNet50 achieved a precision of 97% and an accuracy of 96%, indicating strong


performance in correctly classifying positive instances. However, its recall of 96%
suggests some room for improvement in detecting all positive cases.

ResNet152 had a slightly lower precision of 95% compared to ResNet50, but its accuracy
was on par at 95%. Its recall of 94% was also slightly lower, indicating more false
negatives compared to ResNet50.

VGG16 matched the performance of ResNet50 with a precision of 97% and an accuracy
of 96%. Its recall was also 96%, suggesting a balanced performance across the evaluation
metrics.

VGG19 outperformed the other models with a precision of 97%, accuracy of 97%, and
recall of 97%. This demonstrates consistent and high performance across all metrics,
making it the top-performing model in this comparison.

22
VGG Models Giving best results as compared to Resnet models and in that VGG16
degrades its performance at plastic waste classification therefore VGG19 works well as
compared to different models. Refer to the Radar chart for the analysis report. Refer to
Fig. 5.1

Fig. 5.1: Model Accuracy on Different Waste Types

5.1: Test Results

Simulating the flow of materials at a waste management facility, classification system


will involve receiving solid waste objects one by one and classifying them into their
proper class. The solid waste objects serve as inputs to the pipeline, where they process
one object at a time. After the training model, the most suitable weight model for solid
waste classification. Below are the test results of ResNet50, ResNet152, VGG16 and
VGG19.

23
Fig. 5.2: Wood, Organic, Paper and Cardboard and Textiles Classification

Fig. 5.3: Glass, Aluminium, Plastic and Other Plastic Classification

24
Fig. 5.4: Interface for Solid Waste Classification

Interface that provide two option Upload Image and Capture Image, and also include
waste environmental impact and proper disposal of solid waste

Fig. 5.5: Upload Vegetable Image

User uploads an image of vegetables. The interface processes the image and accurately
classifies it as Organic Waste.

25
Fig. 5.6: Upload Soda Can Image

User uploads an image of a Soda can. The interface processes the image and accurately
classifies it as Aluminium Waste.

Fig. 5.7: Capture Image

User Capture an image of a T-Shirt. The interface processes the image and accurately
classifies it as Textiles.

26
CHAPTER 6

CONCLUSION AND FUTURE SCOPE

In an investigation into solid waste categorization and separation using deep learning,
scrutinized the performance of four prominent CNN architectures—ResNet50,
ResNet152, VGG16, and VGG19—assessing their accuracy, precision, and recall
metrics. Through this evaluation, distinct patterns emerged, showcasing varying
capabilities across the models. Notably, VGG19 exhibited remarkable efficacy in
accurately identifying and categorizing minute waste objects within cluttered scenes.
While VGG19 demonstrated superior performance, challenges inherent in solid
waste classification, such as occlusions and background complexities, remain pertinent.
These findings underscore the importance of continued research into advanced model
architectures and optimization strategies to enhance detection accuracy further.

Furthermore, the successful integration of deep learning-based approaches in waste


management practices holds significant promise for automating waste sorting processes,
thereby streamlining operations and contributing to environmental sustainability. By
leveraging AI-driven solutions, waste management systems can achieve greater
efficiency and accuracy in waste categorization, ultimately facilitating more effective
recycling and resource recovery efforts. However, to fully realize the potential of deep
learning in waste management, ongoing advancements in model development and
integration are essential. Through collaborative efforts between researchers, practitioners,
and policymakers, we can harness the power of deep learning to address the pressing
challenges of waste characterization and management, paving the way for a cleaner, more
sustainable future.

27
Future phases of the research will focus on the implementation of modern classification
algorithms such as Neural Networks and transfer learning to develop research around the
full scope of the waste classification problem. It is expected to work with significantly
larger data sets and to perform multi-class classification, hence, building computationally
efficient programs is within the objectives of future projects. The further improvements in
this project will lead us to develop Autonomous Robotic Waste Sorting Systems which
will be able to efficiently and accurately sort various types of waste and minimizing
human intervention while enhancing sorting speed and precision. This will also lead us to
develop advanced solutions like Real-Time Waste Composition Analysis and Smart
Waste Management Solutions which will help us to reduce human errors in solid waste
management.

28
REFERENCES
1. Majchrowska, S.; Mikołajczyk, A.; Ferlin, M.; Klawikowska, Z.; Plantykow,
M.A.; Kwasigroch, A.; Majek, K. Deep learning-based waste detection in natural
and urban environments. Waste Manag. 2022, 138, 274–284.
2. 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.
3. Rahman, M.W.; Islam, R.; Hasan, A.; Bithi, N.I.; Hasan, M.M.; Rahman, M.M.
Intelligent waste management system using deep learning with IoT. J. King Saud
Univ. Comput. Inf. Sci. 2020, 34, 2072–2087.
4. Khan, R.; Kumar, S.; Srivastava, A.K.; Dhingra, N.; Gupta, M.; Bhati, N.;
Kumari, P. Machine Learning and IoT-Based Waste Management Model. Comput.
Intell. Neurosci. 2021, 2021, 5942574.
5. Chaturvedi, S.; Bikarama Prasad, Y.; Nihal Anwar, S. An Assessment of Machine
Learning Integrated Autonomous Waste Detection and Sorting of Municipal Solid
Waste. Nat. Environ. Pollut. Technol. 2021, 20, 1515–1525.
6. Dubey, S.; Singh, P.; Yadav, P.; Singh, K.K. Household waste management system
using IoT and machine learning. Procedia Comput. Sci. 2020, 167, 1950–1959.
7. Anh Khoa, T.; Phuc, C.H.; Lam, P.D.; Nhu, L.M.B.; Trong, N.M.; Phuong,
N.T.H.; Dung, N.V.; Tan-Y, N.; Nguyen, H.N.; Duc, D.N.M. Waste management
system using IoT-based machine learning in university. Wirel. Commun. Mob.
Comput. 2020, 2020, 6138637.
8. ResNet - Deep Learning from GeeksforGeeks. Accessed on: April 3, 2024.
https://www.geeksforgeeks.org/residual-networks-resnet-deep-learning/
9. VGG (Very Deep Convolutional Networks) from Viso.ai. Accessed on: April 3,
2024. https://viso.ai/deep-learning/vgg-very-deep-convolutional-networks/
10. Pollution Control Department, Booklet on Thailand State of Pollution2018.
Bangkok: S.Mongkon Press Limited Partnership, 2019.
11. Pollution Control Department, Public Guide on Waste Segregation. Bangkok:
He’s Company Limited, 2016.

29
12. Project Energica. Wongpanit’s Waste Sorting Machine, YouTube, Oct. 14, 2015.
Available:https://www.youtube.com/watch?v=gRsEroyc6bg. [Accessed: 5 Mar.
2019].
13. A. Krizhevsky, I. Sutskever, and G. E. Hinton, ImageNet classification with deep
convolutional neural networks, Advances in neural information processing
systems, pp. 1097-1105, January 2012.
14. K. He, X. Zhang, S. Ren, and J. Sun, Deep resudial learning for image
recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), June 2016.
15. G. E. Sakr, M. Mokbel, A. Darwich, M. N. Khneisser, and A. Hadi, “Comparing
deep learning and support vector machines for autonomous waste sorting,” 2016
IEEE International Multidisciplinary Conference on Engineering Technology
(IMCET), November 2016.
16. C. Bircanoğlu, M. Atay, F. Beşer, Ö. Genç, and M. A. Kızrak, RecycleNet:
Intelligent waste sorting using deep neural networks, Innovations in Intelligent
Systems and Applications (INISTA), July 2018.
17. M. S. Rad, A. V. Kaenel, A. Droux et al., A computer vision system to localize
and classify wastes on the streets, in Computer Vision Systems, pp 195-204,
Spring, Cham, 2017.
18. B. S. Costa, A. C. S. Bernardes, J. V. A. Pereira et al., Artificial intelligence in
automated sorting in trash recycling, The Encontro Nacional de Inteligência
Artificial Computacional (ENIAC), October 2018.
19. Y. Chu, C. Huang, X. Xie, B. Tan et al, Multilayer hybrid deep-learning method
for waste clssificastion and recycling, Computational Inttelligence and
Neuroscience, 2018.
20. CCHANG.(2018). Garbage Classification [Data set]. Kaggle. Link to access
https://doi.org/10.34740/KAGGLE/DS/81794

30

You might also like