HomePublicationsCertificationsCompetitionsContributors
Start publication
HomePublicationsCertificationsCompetitionsContributors

Table of contents

Code

Datasets

Files

AboutDocsPrivacyCopyrightContactSupport
© Ready Tensor, Inc.
Back to publications
Nov 29, 2024●115 reads●MIT License

Automated Waste Classifier for Recycling Optimization using YOLO

  • Computer Vision
  • Deep Learning
  • Edge Device Deployment
  • Environmental Sustainability
  • Object Detection
  • Real-Time Detection
  • Recycling Optimization
  • Streamlit Deployment
  • YOLOv5
  • f
    Faisal Hakimi

Table of contents

eco1.png

Abstract

Waste management has become a global environmental challenge, with large amounts of recyclable materials being sent to landfills due to inefficient sorting processes. This research paper presents the development of an automated waste classification system using YOLOv5 for real-time waste detection and sorting. Leveraging the TACO dataset, the model was trained to identify different types of waste, such as plastic bottles, cans, and other recyclable materials.
A real-time system was deployed using Streamlet, allowing for both video/image input and real-time camera-based waste classification. The model achieved a mean Average Precision (mAP50) of 0.301 across multiple categories, demonstrating the viability of automated waste sorting systems in reducing environmental waste and improving recycling efficiency.

1. Introduction

Waste management is a crucial environmental issue that affects public health, resource conservation, and climate change. In many developing countries, like Pakistan, the inefficiency of current waste sorting systems results in recyclable materials ending up in landfills. According to the World Bank report, global waste generation will increase by 70% by 2050, further stressing the need for efficient waste management systems. Automating the waste sorting process can significantly reduce the environmental burden by accurately identifying recyclable materials. This research focuses on building a waste classification system using YOLOv5, a state-of the-art object detection algorithm that is both fast and accurate. Our system aims to assist in real-time waste sorting for smart bins or industrial recycling plants.

1.1 Waste Classification

Waste classification systems use machine learning algorithms to identify and categorize waste items into recyclable and non-recyclable materials. The TACO dataset, which contains labeled images of various waste types, serves as the foundation for training such models. The dataset includes classes such as plastic, metal, paper, and glass.

1.2 Real-Time Detection

The need for real-time detection is crucial in waste sorting systems, especially in industrial settings. YOLOv5’s ability to process images and detect objects quickly makes it an ideal choice for this application. The model can classify waste items and provide instant feedback, facilitating the automation of waste sorting.

1.3 Comparison of YOLOv5 with Other Object Detection Models

Screenshot 2024-11-29 121644.png
YOLOv5, compared to other object detection algorithms like Faster-RCNN and SSD, provides an optimal balance between speed and accuracy. Its real-time capabilities make it suitable for use in automated waste sorting systems.

2. Literature Review

The use of deep learning models for waste classification has been an emerging research area. Early approaches using traditional computer vision techniques like image segmentation and feature extraction lacked the robustness and flexibility needed for diverse waste types. With the advent of convolutional neural networks (CNNs), models such as Faster R-CNN, SSD, and YOLO have shown significant improvements in both speed and accuracy for object detection tasks.
YOLO (You Only Look Once) models have become particularly popular for real-time object detection due to their ability to process images in one pass. YOLOv5, the latest version, provides a balance between accuracy and computational efficiency, making it a suitable choice for real-time waste classification applications.

3. Methodology

Automated_Waste_Classifier_for_Recycling_Optimization_Domain__Computer_Vision__3_-removebg-preview.png

3.1 Dataset Preparation

The TACO Dataset was used, comprising 1,500 labeled images across 10 waste categories (e.g., plastic bottles, glass bottles).

  • Data was divided into:
    • Training set (80%)
    • Validation set (10%)
    • Test set (10%).
      download.png

waste categories:

  • Clear plastic bottel
  • Plastic bottle cap
  • Drink can
  • Other plastic
  • Plastic film
  • Cigarette
  • Glass bottle
  • Meal carton

3.2 Data Preprocessing

1. Annotation Conversion:
Converted COCO-format annotations to YOLO format, normalizing bounding box
coordinates to improve compatibility with YOLOv5.
download (2).png
2. Data Augmentation:
Applied horizontal flipping, brightness adjustment, and rotation to increase data
diversity and prevent overfitting.
download (3).png
3.Image Resizing:
Resized images to 640x640 pixels to match YOLOv5’s input requirements.
download (1).png

3.3 Model Training

We trained a YOLOv5 model on the preprocessed TACO dataset. Key configurations used for training were:

  • Image size: 640x640 pixels.
  • Batch size: 16.
  • Optimizer: Adam optimizer with an initial learning rate of 0.001.
  • Number of epochs: 100.
    The training process was carried out using Google Colab, leveraging a Tesla T4 GPU for faster computation.
    Weights were saved during training, and the best-performing model based on validation metrics was selected for
    evaluation.

3.4 Evaluation Metrics

The model’s performance was evaluated using the following metrics:

  • Precision (P): The proportion of correct positive predictions out of all positive
    predictions.
  • Recall (R): The proportion of actual positive instances that were detected by
    the model.

download (4).png download (5).png

  • mAP50 (Mean Average Precision at IoU 0.5): Evaluates how well the model
    predicted bounding boxes that match
    ground truth objects.
  • mAP50-95: A more stringent evaluation metric that averages precision across IoU thresholds from 0.5 to 0.95.
    download (7).png

Confusion Matrix
The confusion matrix provides a breakdown of the model's performance across different categories by showing the number of true positives, false positives, true negatives, and false negatives for each class. This allows a deeper analysis of how well the model is performing in identifying the correct class and where it might be
making errors.

download (6).png

4. Results

This section presents the performance of the YOLOv5-based automated waste classification system, highlighting quantitative metrics, class-wise analysis, error analysis, and real-time deployment results.

4.1 Model Performance

The YOLOv5 model was evaluated on the test set using industry-standard object detection metrics. The results are as follows:

  • Overall performance (all classes):

    • Precision: 0.458
    • Recall: 0.281
    • Mean Average Precision (mAP50): 0.301
    • Mean Average Precision (mAP50-95): 0.205
  • Class-Wise Performance
    The model's detection capabilities varied across waste categories:

Screenshot 2024-11-29 154504.png
Class-wise analysis showed strong performance for categories such as glass bottles (Precision: 0.824, Recall: 0.556) and clear plastic bottles (Precision: 0.56, Recall: 0.593). However, smaller and visually ambiguous items, like plastic film and cigarette butts, had lower precision and recall scores, highlighting areas for improvement.

download (9).png
download (10).png

5. Real-Time Deployment and Testing

The trained model was deployed using a Streamlit-based application for real-time waste classification. Two modes of operation were tested:

Check out here [https://ecovision-0.streamlit.app/)

Screenshot 2024-09-15 234755.png

  • image and Video Uploads: The model processed uploaded media with an average inference time of 10 ms per frame, achieving consistent classification accuracy.
  • Live Camera Feed: Real-time classification performed reliably, with detected objects annotated with bounding boxes and labels. However, lighting variations and cluttered backgrounds occasionally resulted in false positives.

5.1 Key Results and Analysis

The system demonstrated its efficacy in identifying recyclable materials, achieving high accuracy for distinct categories like glass bottles and drink cans. A confusion matrix revealed that misclassifications commonly occurred between visually similar classes, such as plastic film and plastic wrappers. These errors were attributed to overlapping features under certain lighting conditions.
download (8).png
Checkout for video result: [https://drive.google.com/file/d/1bzONLKUkE49Qt5uOJv4wpQIm_a6rzdxv/view?usp=sharing)

6. Discussion

The real-time waste classification system demonstrated significant potential for improving waste sorting efficiency. By automating the identification and categorization of recyclable materials, the system can reduce human error, lower operational costs, and improve recycling outcomes. While the model performed well for larger and distinct waste categories, future work will focus on improving its detection of smaller and visually similar waste items.

6.1 Future Work

  • Edge Device Deployment: Deploy the model on low-cost edge devices like Raspberry Pi to enable distributed and real-time waste classification in low resource settings.
  • Model Fine-Tuning: Improve the model’s performance on smaller, less-distinct waste categories by augmenting the dataset and fine-tuning the model.
  • Industrial Robotics: The model can be deployed in recycling plants, where robotic arms equipped with the YOLOv5 system can automatically sort waste on conveyor belts. This would enhance sorting efficiency, reduce labor costs, and
    increase throughput in industrial settings.
    Automated_Waste_Classifier_for_Recycling_Optimization_Domain__Computer_Vision__2_-removebg-preview.png
  • Underwater Waste Detection: Another promising application is adapting the system for underwater waste detection. Integrated into autonomous underwater vehicles (AUVs) or drones, the model could help identify and collect submerged
    waste, such as plastics, to address marine pollution and protect ecosystems.
    [https://youtu.be/On5WUCUNmfc?si=VBqbp1-NVX_VpAvd)
    [https://youtu.be/qSI22-A8dMA?si=bpsKDfomMJ0O8-dW)

7. Conclusion

This research successfully developed an automated waste classification system using YOLOv5, trained on the TACO dataset, and deployed for real-time analysis using Streamlit. The model achieved a mean Average Precision (mAP50) of 0.301, and its real-time deployment opens up opportunities for smart waste bins and industrial sorting applications. Future work will focus on enhancing the model's accuracy and extending its deployment to edge devices for broader use cases.

References

  1. Redmon, J., & Farhadi, A. (2018). "YOLOv3: An Incremental Improvement." arXiv preprint arXiv
    .02767.
  2. Bochkovskiy, A., Wang, C., & Liao, H. M. (2020). "YOLOv4: Optimal Speed and Accuracy of Object Detection."
    arXiv preprint arXiv
    .10934.
  3. The World Bank. (2018). "What a Waste 2.0: A Global Snapshot of Solid Waste Management to 2050."
  4. Pires, A., Martinho, G., & Chang, N. B. (2011). "Solid waste management in European countries: A review of
    systems analysis techniques." Journal of Environmental Management, 92(4), 1033-1050.

Table of contents

Files

  • download.jfif
  • download (1).jfif
Your publication could be next!

Join us today and publish for free

Sign Up for free!

Table of contents

Files

  • download.jfif
  • download (1).jfif

Datasets

  • Tacotrashdataset

Datasets

  • Tacotrashdataset