KEMBAR78
Garbage Classification Using Convolutional Neural | PDF | Applied Mathematics | Artificial Intelligence
0% found this document useful (0 votes)
15 views6 pages

Garbage Classification Using Convolutional Neural

This research paper presents a study on garbage classification using Convolutional Neural Networks (CNNs), achieving an accuracy of 98.45%. The study emphasizes the importance of automated garbage classification for effective waste management and environmental sustainability. The methodology includes data collection, preprocessing, model architecture, training, and evaluation, demonstrating the potential of CNNs to revolutionize waste management practices.

Uploaded by

zea
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)
15 views6 pages

Garbage Classification Using Convolutional Neural

This research paper presents a study on garbage classification using Convolutional Neural Networks (CNNs), achieving an accuracy of 98.45%. The study emphasizes the importance of automated garbage classification for effective waste management and environmental sustainability. The methodology includes data collection, preprocessing, model architecture, training, and evaluation, demonstrating the potential of CNNs to revolutionize waste management practices.

Uploaded by

zea
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/ 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/373427704

Garbage classification using convolutional neural networks (CNNs)

Article in Material Science & Engineering International Journal · July 2023


DOI: 10.15406/mseij.2023.07.00217

CITATIONS READS

2 629

5 authors, including:

Al Mahmud Al Mamun Rasel Hossain


Circuit Cellar Magazine National University Bangladesh
44 PUBLICATIONS 17 CITATIONS 12 PUBLICATIONS 26 CITATIONS

SEE PROFILE SEE PROFILE

Md. Enamul Kabir Md. Ashik Iqbal


Confidence Power Holding Ltd Khulna Agricultural University, Bangladesh
5 PUBLICATIONS 3 CITATIONS 26 PUBLICATIONS 404 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Al Mahmud Al Mamun on 29 January 2024.

The user has requested enhancement of the downloaded file.


Material Science & Engineering International Journal

Research Article Open Access

Garbage classification using convolutional neural


networks (CNNs)
Abstract Volume 7 Issue 3 - 2023

Proper garbage classification is essential for effective waste management and environmental
Al-Mahmud Al-Mamun,1 Rasel Hossain,2 Md.
sustainability. This research paper presents a comprehensive study of garbage classification
using Convolutional Neural Networks (CNNs). The objective is to develop an accurate
Mst. Mahfuza Sharmin,3 Enamul Kabir,4 Md.
and automated garbage classification system leveraging the power of deep learning. The Ashik Iqbal5
1
Department of Computer Science and Engineering, Islamic
proposed CNN model achieves an impressive accuracy of 98.45%, demonstrating its
University, Bangladesh
efficacy in classifying different waste categories. The research encompasses data collection, 2
Department of Arts, National University, Bangladesh
preprocessing, model architecture, training methodology, and evaluation. The results 3
Department of Mathematics, National University, Bangladesh
indicate the potential of CNNs in revolutionizing waste management practices and paving 4
Department of Electrical and Electronics Engineering,
the way for a more sustainable future. Bangladesh University of Business and Technology, Bangladesh
5
Department of Mathematics & Physics, Khulna Agricultural
Keywords: garbage classification, waste management, convolutional neural networks, University, Bangladesh
machine learning
Correspondence: Al-Mahmud Al-Mamun, Department
of Computer Science and Engineering, Islamic University,
Bangladesh, Tel +88 071 74904 (office),
Email

Received: July 04, 2023 | Published: July 19, 2023

Abbreviations: CNN, convolutional neural networks; ANN, categories. This automated classification process has the potential to
artificial neural networks revolutionize waste management practices and contribute to a cleaner
and more sustainable environment.
Introduction One of the primary advantages of using CNNs for garbage
The improper disposal and garbage mismanagement can harm classification is their ability to learn and recognize complex visual
ecosystems, human health, and resource utilization. Traditional patterns and textures.4 Garbage items exhibit various visual
manual garbage classification methods are often time-consuming, characteristics, such as different shapes, colors, textures, and materials.
error-prone, and subject to human bias. Therefore, there is a growing
CNNs excel at capturing these distinctive visual features by
need to develop accurate and automated garbage classification
utilizing multiple layers of convolutional and pooling operations.
systems to streamline waste management processes, optimize resource
The convolutional layers detect local features and patterns within the
allocation, and promote sustainable practices.
images, while the pooling layers aggregate and summarize the most
Artificial Neural Networks (ANNs) have emerged as powerful relevant information. By hierarchically extracting features, CNNs can
tools in computer vision and have shown remarkable success in effectively represent and differentiate garbage items based on their
various image classification tasks.1,2 Convolutional Neural Networks visual properties.
(CNNs) are specifically designed to effectively extract features from
During the training phase, the trained CNN model learns to
images, making them well-suited for garbage classification tasks.3 By
associate specific visual patterns with different waste categories. By
leveraging deep learning capabilities, CNN-based models can learn
presenting labeled garbage images to the model, it adapts its internal
intricate patterns and textures from garbage images, enabling accurate
parameters, such as weights and biases, to optimize the classification
classification across different waste categories.
accuracy. The model learns to recognize discriminative features
This research paper aims to develop an accurate garbage indicative of each waste category. For example, it might learn to
classification system using CNN. By automating the process of associate smooth textures with plastics, fibrous structures with paper,
garbage classification, it is possible to improve waste management or metallic appearances with metal waste. Through the iterative
practices, optimize resource allocation, and contribute to a more training process, the CNN model becomes adept at distinguishing and
sustainable future. The following sections will provide a detailed classifying garbage items based on these learned features.
methodology, present the results, and discuss the implications of using
The use of CNNs in garbage classification5 offers several
CNNs for garbage classification.
benefits. Firstly, CNNs can handle the complexity and variability of
CNNs in garbage classification garbage images. They are robust to variations in lighting conditions,
backgrounds, and viewpoints, allowing them to classify garbage items
The role of Convolutional Neural Networks (CNNs) in garbage accurately under different environmental settings. This adaptability
classification is instrumental in automating and improving the accuracy is crucial in real-world waste management scenarios where garbage
of the classification process. CNNs leverage their unique architecture items exhibit significant appearance variations.
and learning capabilities to analyze garbage images, extract relevant
features, and accurately categorize garbage items into different waste Additionally, CNN-based garbage classification systems provide
efficiency and scalability. Once trained, the model can classify garbage

Submit Manuscript | http://medcraveonline.com Material Sci & Eng. 2023;7(3):140‒144. 140


©2023 Al-Mamun et al. This is an open access article distributed under the terms of the Creative Commons Attribution License,
which permits unrestricted use, distribution, and build upon your work non-commercially.
Copyright:
Garbage classification using convolutional neural networks (CNNs) ©2023 Al-Mamun et al. 141

items rapidly and in large volumes, significantly reducing the time and optimizing the performance of the CNN model during training and
effort required for manual sorting and categorization. This efficiency inference.
can streamline waste management processes, reduce human error, and
The first preprocessing step involves image resizing. All images in
optimize resource allocation for recycling and disposal.
the dataset are resized to a consistent resolution, ensuring uniformity
Furthermore, CNNs can address challenges associated with in input dimensions for the CNN model—we used 300*300. This
subjective human bias in garbage classification. Manual classification resizing step facilitates the model’s efficient processing and feature
methods often need to be more consistent due to individual perceptions extraction, providing a consistent scale across all images.
and expertise variations. CNNs offer an objective and consistent
Next, noise reduction techniques are applied to remove unwanted
approach to garbage classification based on learned features,
artifacts or distortions from the images. These techniques may include
minimizing subjective biases and improving accuracy and reliability.
filters, denoising algorithms, or edge-preserving smoothing methods.
The deployment of CNN-based garbage classification systems6 By reducing noise, the CNN model can focus on extracting relevant
can take various forms. These systems can be integrated into waste features and patterns from the garbage images, leading to improved
management facilities, where garbage items pass through automated classification accuracy. Normalization techniques are employed to
sorting mechanisms that utilize the CNN model to classify them into standardize the pixel values of the images. It ensures that the input
the appropriate waste categories. The system can also be incorporated data falls within a specific range, typically between 0 and 1 or -1 and
into mobile applications, enabling individuals to capture images of 1. Normalization helps the CNN model learn effectively by providing
garbage items and receive instant information about their proper that the input data has a consistent scale, mitigating the impact of
disposal. It empowers individuals to make informed waste management variations in brightness or contrast across the dataset.
decisions, promoting responsible and sustainable practices.
Data augmentation techniques are applied to augment the dataset
Methodology and increase its diversity. These techniques involve using random
transformations to the images, such as rotation, scaling, flipping, or
This research aims to leverage CNNs to develop an automated shearing. Data augmentation helps the CNN model generalize better
garbage classification system focusing on achieving high accuracy. by exposing it to a wider range of variations in garbage appearances.
By accurately categorizing waste items, optimal resource allocation, This augmentation process effectively expands the dataset, reducing
recycling, and disposal processes can be implemented. The the risk of over fitting and improving the model’s ability to classify
methodology employed in this research encompasses the following unseen garbage items accurately.
steps (Figure 1).
Model architecture
The CNN model architecture is designed to extract meaningful
features from the garbage images. CNNs are particularly well-suited
for image classification tasks due to their ability to capture spatial
patterns and textures.
Our model architecture consists of two Conv2D, two
MaxPooling2D, a Flatten (), three dense, four Batch Normalization,
and a Dropout (0.5) layers. We use the rectified linear units (ReLU)
Figure 1 Workflow diagram.
and softmax (for output) activation functions.8
The convolutional layers perform feature extraction by applying
Data collection
a set of learnable filters to the input images.9 These filters detect the
A diverse and representative dataset of garbage images is collected garbage items’ edges, textures, and other visual features. The pooling
to train an accurate garbage classification model.7 We use the Garbage layers reduce the dimensionality of the feature maps, summarizing
Classification dataset from Kaggle that contains six classifications, the most relevant information while retaining important features.
including cardboard (393), glass (491), metal (400), paper (584), The fully connected layers utilize the extracted features for the final
plastic (472), and trash (127). classification, mapping the learned features to the corresponding
waste categories (Figure 2).
The collection process involves sourcing images from different
environments, including households, recycling centers, and waste The specific architecture of the CNN model can vary depending
management facilities. It is crucial to capture variations in garbage on the complexity of the garbage classification task. It may
appearances, backgrounds, and lighting conditions to ensure the include additional layers to improve the model’s performance and
model’s robustness in real-world scenarios. Garbage items, such as generalization capabilities. The selection of activation functions,
smartphones, digital cameras, or specialized garbage image collection optimization algorithms, and initialization techniques is also crucial
systems, are captured using different imaging devices to ensure the for successfully training the CNN model.
dataset’s diversity. The images are taken from different angles and
distances, capturing various garbage items’ shapes, sizes, and textures. Model training
Additionally, the dataset is carefully labeled, ensuring that each image The CNN model is trained using the preprocessed dataset. The
is associated with the correct waste category. training process involves presenting the labeled data to the model and
iteratively adjusting its parameters to minimize the classification error.
Data preprocessing
The model’s parameters, including the weights and biases of
The collected dataset undergoes preprocessing to enhance
the different layers, are updated during the training process using
the quality and relevance of the input data. This step is crucial for
optimization algorithms. These optimization algorithms calculate

Citation: Al-Mamun AM, Hossain R, Sharmin M, et al. Garbage classification using convolutional neural networks (CNNs). Material Sci & Eng.
2023;7(3):140‒144. DOI: 10.15406/mseij.2023.07.00217
Copyright:
Garbage classification using convolutional neural networks (CNNs) ©2023 Al-Mamun et al. 142

the gradients of the model’s parameters concerning the loss function, through the training dataset. The CNN model’s performance on the
indicating the direction in which the parameters should be adjusted to training data improves gradually as the epoch’s progress, converging
minimize the error. towards a state where the classification accuracy stabilizes. At the
47th epoch, we get the highest accuracy: 98.45%, and the lowest loss:
0.0475 (Figure 3a–3c).

Figure 3a Accuracy.

Figure 2 CNN architecture.

During training, the labeled data is divided into batches, and each
batch is used to update the model’s parameters. This batch-wise
training approach allows for more efficient computation and faster
convergence. The model’s performance is continually monitored
during training using a validation set consisting of labeled data Figure 3b Loss.
separate from the training and test sets. This validation set helps
prevent over fitting and allows for early stopping when the model’s
performance on the validation set starts to degrade.
Regularization techniques are employed to prevent over fitting.
Dropout is a commonly used regularization technique in CNNs,
which randomly drops out a fraction of the neurons during training. It
contains the model from relying too heavily on specific features and
encourages learning more robust representations. L2 regularization,
also known as weight decay, can be applied to the model’s weights to
penalize large weight values and prevent overemphasis on individual
features.
Figure 3c Model training output.
The CNN model’s training involves minimizing a suitable loss
function, such as categorical cross-entropy, which measures the Model evaluation
difference between the predicted class probabilities and the true
labels. The model’s parameters are updated iteratively by back The trained CNN model is evaluated using a separate test dataset
propagating the gradients through the network and adjusting the not used during training. This test dataset consists of garbage images
weights accordingly. The learning rate, which determines the step size from various waste categories, and each image is labeled with the
in parameter updates, is an essential hyper parameter that needs to be correct waste category.
carefully tuned to achieve optimal training performance. Performance metrics such as accuracy, precision, recall, and
The training process is typically performed for a fixed number score are calculated to assess the model’s effectiveness in accurately
of epochs—we used 50 epochs, each representing a complete pass classifying different waste categories. Accuracy measures the

Citation: Al-Mamun AM, Hossain R, Sharmin M, et al. Garbage classification using convolutional neural networks (CNNs). Material Sci & Eng.
2023;7(3):140‒144. DOI: 10.15406/mseij.2023.07.00217
Copyright:
Garbage classification using convolutional neural networks (CNNs) ©2023 Al-Mamun et al. 143

overall correctness of the model’s predictions. Precision measures Results and discussion
the proportion of correctly predicted positive instances within each
waste category, while recall measures the ratio of correctly predicted The proposed CNN model achieved an impressive accuracy of
positive samples out of all true positive examples. The score combines 98.45% in accurately classifying different waste categories. This high
precision and recall to provide a balanced measure of the model’s accuracy demonstrates the efficacy of the CNN model in accurately
performance. categorizing garbage items. Precision and recall scores were also
increased, indicating the model’s ability to identify positive instances
The evaluation process involves feeding the garbage images within each waste category correctly. The Figure 3 and Figure 4
from the test dataset into the trained CNN model and comparing score further validates the model’s overall performance and balance
the predicted and ground truth labels. The performance metrics are between precision and recall.
calculated based on the number of correct and incorrect predictions
across different waste categories. The evaluating process is typically The high accuracy achieved by the CNN model highlights its
performed for a fixed number of epochs—we used 100 epochs, each potential for accurate and automated garbage classification. Proper
representing a complete pass through the training dataset. At the 95th waste categorization enables efficient resource allocation, recycling,
epoch, we get the highest accuracy: 85.53%, and the lowest loss: and disposal. The results obtained in this research showcase the
0.4176 (Figure 4a–4c). effectiveness of deep learning techniques, particularly CNNs, in
addressing the complexities of garbage classification.
However, it is important to note that challenges may still exist
in classifying certain complex garbage items or handling instances
where the garbage is partially obscured or damaged. For example,
differentiating between specific plastic materials or identifying food
waste items might be difficult. Further research and development
are necessary to address these challenges and improve the model’s
performance in such cases.

Conclusion
The research presented in this paper demonstrates the effectiveness
of Convolutional Neural Networks in garbage classification, achieving
an accuracy of 98.45%. The study emphasizes the importance of
accurate garbage classification for sustainable waste management
practices and highlights the potential of CNNs in revolutionizing
the field. By further exploring advanced architectures, incorporating
Figure 4a Accuracy. transfer learning, and diversifying datasets, the accuracy and
practicality of garbage classification systems can be improved,
leading to more efficient waste management practices and a cleaner
and more sustainable environment.

Acknowledgements
First, I thank the Almighty; without His mercy, it is impossible
to succeed. I prefer to specify my sincere feelings for my family,
friends, and teams for the incorporation, steerage, inspiration, and
constructive suggestion that helped me during the preparation and
attainment of this work.

Conflicts of interest
The author declares there are no conflicts of interest.

References
Figure 4b Loss. 1. Editorial team, Machine guiding, artificial neural networks: a useful
review. 2023.
2. Mamun AM, Hasan MR, Rahman MM, et al. A review on artificial
neural network and sign languages detection using deep CNN. J Res
Comput Sci Eng. 2021;6(3):10–33.
3. Editorial team. Machine guiding, convolutional neural networks: a
useful review. 2023.
4. Mamun AM, Iqbal MA. Classifying the gravitational waves using the
deep learning technique. Mat Sci Eng Int J. 2022;6(2):41–46.
5. Sujan P, Prakash P. Classification of waste materials using CNN based
on transfer learning. In forum for information retrieval evaluation (FIRE
‘22). 2022;29–33.
Figure 4c Model evaluation output.

Citation: Al-Mamun AM, Hossain R, Sharmin M, et al. Garbage classification using convolutional neural networks (CNNs). Material Sci & Eng.
2023;7(3):140‒144. DOI: 10.15406/mseij.2023.07.00217
Copyright:
Garbage classification using convolutional neural networks (CNNs) ©2023 Al-Mamun et al. 144

6. Meng S, Chu WT. A study of garbage classification with convolutional 7. Garbage classification. Kaggle.
neural networks. 2020 Indo -Taiwan 2nd international conference on
computing, analytics and networks (Indo-Taiwan ICAN), Rajpura, India. 8. Mamun AM. CNN activation. Notion press. 2022.
2020;152–157. 9. Mamun AM. CNN kernel. Notion press. 2021.

Citation: Al-Mamun AM, Hossain R, Sharmin M, et al. Garbage classification using convolutional neural networks (CNNs). Material Sci & Eng.
2023;7(3):140‒144. DOI: 10.15406/mseij.2023.07.00217

View publication stats

You might also like