Garbage Detection system which will detect objects based on whether it is plastic waste or plastics or just garbage.

Overview

Garbage Detection using Yolov5 on Jetson Nano 2gb Developer Kit.

Garbage detection system which will detect objects based on whether it is plastic waste or plastics or just garbage.

Aim and Objectives

Aim

To create a Garbage detection system which will detect objects based on whether it is plastic waste or plastics or just garbage.

Objectives

➢ The main objective of the project is to create a program which can be either run on Jetson nano or any pc with YOLOv5 installed and start detecting using the camera module on the device.

➢ Using appropriate datasets for recognizing and interpreting data using machine learning.

➢ To show on the optical viewfinder of the camera module whether objects are plastics or plastic waste or garbage.

Abstract

➢ An object is classified based on whether it is plastics, plastic waste, garbage etc and is detected by the live feed from the system’s camera.

➢ We have completed this project on jetson nano which is a very small computational device.

➢ A lot of research is being conducted in the field of Computer Vision and Machine Learning (ML), where machines are trained to identify various objects from one another. Machine Learning provides various techniques through which various objects can be detected.

➢ One such technique is to use YOLOv5 with Roboflow model, which generates a small size trained model and makes ML integration easier.

➢ Garbage has become a major problem for developing countries as their rate of growth also results in enormous consumption of products and hence more waste.

➢ Garbage segregation based on recyclable waste and unrecyclable waste like certain plastics helps solve the problem of garbage as well as helps in the further growth of economy by reusing certain recyclable material.

Introduction

➢ This project is based on a Garbage detection model with modifications. We are going to implement this project with Machine Learning and this project can be even run on jetson nano which we have done.

➢ This project can also be used to gather information about what category of waste does the object comes in.

➢ The objects can even be further classified into liquid, solid, organic, inorganic waste based on the image annotation we give in roboflow.

➢ Garbage detection sometimes becomes difficult as certain waste gets mixed together and gets harder for the model to detect. However, training in Roboflow has allowed us to crop images and also change the contrast of certain images to match the time of day for better recognition by the model.

➢ Neural networks and machine learning have been used for these tasks and have obtained good results.

➢ Machine learning algorithms have proven to be very useful in pattern recognition and classification, and hence can be used for Garbage detection as well.

Literature Review

➢ There is no denying that India has improved its sanitation coverage, but the country’s biggest shortcoming is its poor waste management infrastructure.

➢ Where solid waste is properly managed, after the waste is generated, it is segregated at source, then properly stored, collected, transported and treated. In an effective solid waste management model, there should be a goal to reduce, reuse, recover and recycle waste by using the appropriate technologies and the waste that is disposed of in landfills should be minimized, most importantly, landfills should be properly managed so that they don’t become a source of greenhouse gases and toxins.

➢ The waste that is generated is just recklessly dumped in most cases, some is dumped on the streets, and some is dumped in landfills that are not properly managed and this ends up polluting the air, soil, and underground water.

➢ There are not enough public bins, and the available bins are not even covered and, in many cases, waste overflows out of those bins and ends up going all over the streets.

➢ India’s informal recycling sector that consists of waste pickers plays a crucial role in segregating and recycling waste, but in most cases, they are not formally trained and at times they burn wastes at landfills to keep themselves warm at night and end up setting landfill fires that cause air pollution, and because of inadequate gear, they are also exposed to diseases and injuries.

➢ The sizes of landfills in India are constantly increasing and that is fast becoming a major concern.

Jetson Nano Compatibility

➢ The power of modern AI is now available for makers, learners, and embedded developers everywhere.

➢ NVIDIA® Jetson Nano™ Developer Kit is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts.

➢ Hence due to ease of process as well as reduced cost of implementation we have used Jetson nano for model detection and training.

➢ NVIDIA JetPack SDK is the most comprehensive solution for building end-to-end accelerated AI applications. All Jetson modules and developer kits are supported by JetPack SDK.

➢ In our model we have used JetPack version 4.6 which is the latest production release and supports all Jetson modules.

Proposed System

  1. Study basics of machine learning and image recognition.

  2. Start with implementation

     ➢ Front-end development
     ➢ Back-end development
    
  3. Testing, analysing and improvising the model. An application using python and Roboflow and its machine learning libraries will be using machine learning to identify whether objects are plastics, plastic waste like bottles or garbage.

  4. Use datasets to interpret the object and suggest whether the object is plastic waste, plastics or garbage.

Methodology

The Garbage detection system is a program that focuses on implementing real time Garbage detection.

It is a prototype of a new product that comprises of the main module: Garbage detection and then showing on viewfinder whether the object is garbage or not.

Garbage Detection Module

This Module is divided into two parts:
1] Garbage detection

➢ Ability to detect the location of object in any input image or frame. The output is the bounding box coordinates on the detected object.

➢ For this task, initially the Dataset library Kaggle was considered. But integrating it was a complex task so then we just downloaded the images from gettyimages.ae and google images and made our own dataset.

➢ This Datasets identifies object in a Bitmap graphic object and returns the bounding box image with annotation of object present in a given image.

2] Classification Detection

➢ Classification of the object based on whether it is garbage or not.

➢ Hence YOLOv5 which is a model library from roboflow for image classification and vision was used.

➢ There are other models as well but YOLOv5 is smaller and generally easier to use in production. Given it is natively implemented in PyTorch (rather than Darknet), modifying the architecture and exporting and deployment to many environments is straightforward.

➢ YOLOv5 was used to train and test our model for various classes like Plastics, plastic waste, garbage. We trained it for 149 epochs and achieved an accuracy of approximately 91%.

Jetson Nano 2GB Developer Kit.

Setup

Demo1

Demo2

Demo3

Demo4

Installation

Initial Setup

Remove unwanted Applications.

sudo apt-get remove --purge libreoffice*
sudo apt-get remove --purge thunderbird*

Create Swap file

sudo fallocate -l 10.0G /swapfile1
sudo chmod 600 /swapfile1
sudo mkswap /swapfile1
sudo vim /etc/fstab
###########add line###########
/swapfile1 swap swap defaults 0 0

Cuda Configuration

vim ~/.bashrc
#############add line #############
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATh=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
source ~/.bashrc

Udpade and Upgrade a System

sudo apt-get update
sudo apt-get upgrade

Install Some Required Packages

sudo apt install curl
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py
sudo apt-get install libopenblas-base libopenmpi-dev
sudo apt-get install python3-dev build-essential autoconf libtool pkg-config python-opengl python-pil python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev libssl-dev libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev libfreetype6-dev python3-dev
vim ~/.bashrc
###### add line ########
export OPENBLAS_CORETYPE=ARMV8
source ~/.bashrc
sudo pip3 install pillow

Install Torch

curl -LO https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl
mv p57jwntv436lfrd78inwl7iml6p13fzh.whl torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo pip3 install torch-1.8.0-cp36-cp36m-linux_aarch64.whl

#Check Torch, output should be "True"

sudo python3 -c "import torch; print(torch.cuda.is_available())"

Installation of torchvision.

git clone --branch v0.9.1 https://github.com/pytorch/vision torchvision
cd torchvision/
sudo python3 setup.py install

Clone yolov5 Repositories and make it Compatible with Jetson Nano.

cd
git clone https://github.com/ultralytics/yolov5.git
cd yolov5/
sudo pip3 install numpy==1.19.4

# comment torch,PyYAML and torchvision in requirement.txt

sudo pip3 install --ignore-installed PyYAML>=5.3.1
sudo pip3 install -r requirements.txt

Download weights and Test Yolov5 Installation on USB webcam

sudo python3 detect.py
sudo python3 detect.py --weights yolov5s.pt --source 0

Garbage Dataset Training

We used Google Colab And Roboflow

train your model on colab and download the weights and past them into yolov5 folder link of project

Running Garbage Detection Model

source '0' for webcam

!python detect.py --weights best.pt --img 416 --conf 0.1 --source 0

Output Video

garbage_detection.mp4

Advantages

➢ The Garbage detection system will be of great help in reducing diseases that occur because of poor waste management.

➢ The Garbage detection system shows the classification of the object whether they are plastics, plastic waste like bottles or just plain garbage.

➢ It can then convey to the person who cleans or if it needs to be completely automated then to the segregating machine to separate the waste according to the classes specified.

➢ When completely automated no user input is required and therefore works with absolute efficiency and speed.

➢ As it is completely automated the cost of segregation of waste decreases significantly.

➢ It can work around the clock and therefore becomes more cost efficient.

Application

➢Detects object class like plastic or plastic waste in a given image frame or viewfinder using a camera module.

➢ Can be used in various garbage segregation plants.

➢ Can be used as a refrence for other ai models based on Garbage detection.

Future Scope

➢ As we know technology is marching towards automation, so this project is one of the step towards automation.

➢ Thus, for more accurate results it needs to be trained for more images, and for a greater number of epochs.

➢ Garbage segregation will become a necessity in the future due to rise in population and hence our model will be of great help to tackle the situation in an efficient way.

➢ As more products gets released due to globalization and urbanization new waste will be created and hence our model which can be trained and modified with just the addition of images can be very useful.

Conclusion

➢ In this project our model is trying to detect objects and then showing it on viewfinder, live as what their class is as whether they are plastics, plastic waste or garbage as we have specified in Roboflow.

➢ The model solves the problem of garbage segregation in modern India and helps counteract and prevent water borne diseases.

➢ Lower diseases lead to better economy of country as the workforce doesn’t get affected and hence can go to work with no problem.

Refrences

1] Roboflow :- https://roboflow.com/

2] Datasets or images used: https://www.gettyimages.ae/search/2/image?phrase=garbage

3] Google images

Articles

[1] https://www.recycling-magazine.com/2020/05/06/waste-management-crisis-in-india/#:~:text=Urban%20India%20generates%2062%20million,just%2011.9%20million%20is%20treated.

[2] https://www.downtoearth.org.in/blog/waste/india-s-challenges-in-waste-management-56753

Owner
Rishikesh A. Bondade
Fresher
Rishikesh A. Bondade
A package to predict protein inter-residue geometries from sequence data

trRosetta This package is a part of trRosetta protein structure prediction protocol developed in: Improved protein structure prediction using predicte

Ivan Anishchenko 185 Jan 07, 2023
A privacy-focused, intelligent security camera system.

Self-Hosted Home Security Camera System A privacy-focused, intelligent security camera system. Features: Multi-camera support w/ minimal configuration

Scott Barnes 175 Jan 01, 2023
Notepy is a full-featured Notepad Python app

Notepy A full featured python text-editor Notable features Autocompletion for parenthesis and quote Auto identation Syntax highlighting Compile and ru

Mirko Rovere 11 Sep 28, 2022
SuMa++: Efficient LiDAR-based Semantic SLAM (Chen et al IROS 2019)

SuMa++: Efficient LiDAR-based Semantic SLAM This repository contains the implementation of SuMa++, which generates semantic maps only using three-dime

Photogrammetry & Robotics Bonn 701 Dec 30, 2022
Classify the disease status of a plant given an image of a passion fruit

Passion Fruit Disease Detection I tried to create an accurate machine learning models capable of localizing and identifying multiple Passion Fruits in

3 Nov 09, 2021
An easier way to build neural search on the cloud

An easier way to build neural search on the cloud Jina is a deep learning-powered search framework for building cross-/multi-modal search systems (e.g

Jina AI 17k Jan 02, 2023
HomoInterpGAN - Homomorphic Latent Space Interpolation for Unpaired Image-to-image Translation

HomoInterpGAN Homomorphic Latent Space Interpolation for Unpaired Image-to-image Translation (CVPR 2019, oral) Installation The implementation is base

Ying-Cong Chen 99 Nov 15, 2022
ICLR 2021 i-Mix: A Domain-Agnostic Strategy for Contrastive Representation Learning

Introduction PyTorch code for the ICLR 2021 paper [i-Mix: A Domain-Agnostic Strategy for Contrastive Representation Learning]. @inproceedings{lee2021i

Kibok Lee 68 Nov 27, 2022
A PyTorch implementation of "SimGNN: A Neural Network Approach to Fast Graph Similarity Computation" (WSDM 2019).

SimGNN ⠀⠀⠀ A PyTorch implementation of SimGNN: A Neural Network Approach to Fast Graph Similarity Computation (WSDM 2019). Abstract Graph similarity s

Benedek Rozemberczki 534 Dec 25, 2022
An end-to-end implementation of intent prediction with Metaflow and other cool tools

You Don't Need a Bigger Boat An end-to-end (Metaflow-based) implementation of an intent prediction flow for kids who can't MLOps good and wanna learn

Jacopo Tagliabue 614 Dec 31, 2022
2021 Artificial Intelligence Diabetes Datathon

A.I.D.D. 2021 2021 Artificial Intelligence Diabetes Datathon A.I.D.D. 2021은 ‘2021 인공지능 학습용 데이터 구축사업’을 통해 만들어진 학습용 데이터를 활용하여 당뇨병을 효과적으로 예측할 수 있는가에 대한 A

2 Dec 27, 2021
OpenGAN: Open-Set Recognition via Open Data Generation

OpenGAN: Open-Set Recognition via Open Data Generation ICCV 2021 (oral) Real-world machine learning systems need to analyze novel testing data that di

Shu Kong 90 Jan 06, 2023
GEP (GDB Enhanced Prompt) - a GDB plug-in for GDB command prompt with fzf history search, fish-like autosuggestions, auto-completion with floating window, partial string matching in history, and more!

GEP (GDB Enhanced Prompt) GEP (GDB Enhanced Prompt) is a GDB plug-in which make your GDB command prompt more convenient and flexibility. Why I need th

Alan Li 23 Dec 21, 2022
A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

Korbinian Pöppel 47 Nov 28, 2022
Machine Learning University: Accelerated Computer Vision Class

Machine Learning University: Accelerated Computer Vision Class This repository contains slides, notebooks, and datasets for the Machine Learning Unive

AWS Samples 1.3k Dec 28, 2022
1st ranked 'driver careless behavior detection' for AI Online Competition 2021, hosted by MSIT Korea.

2021AICompetition-03 본 repo 는 mAy-I Inc. 팀으로 참가한 2021 인공지능 온라인 경진대회 중 [이미지] 운전 사고 예방을 위한 운전자 부주의 행동 검출 모델] 태스크 수행을 위한 레포지토리입니다. mAy-I 는 과학기술정보통신부가 주최하

Junhyuk Park 9 Dec 01, 2022
Annotate datasets with a semi-trained or fully trained YOLOv5 model

YOLOv5 Auto Annotator Annotate datasets with a semi-trained or fully trained YOLOv5 model Prerequisites Ubuntu =20.04 Python =3.7 System dependencie

Akash James 3 May 14, 2022
Pre-training of Graph Augmented Transformers for Medication Recommendation

G-Bert Pre-training of Graph Augmented Transformers for Medication Recommendation Intro G-Bert combined the power of Graph Neural Networks and BERT (B

101 Dec 27, 2022
Generalized Matrix Means for Semi-Supervised Learning with Multilayer Graphs

Generalized Matrix Means for Semi-Supervised Learning with Multilayer Graphs MATLAB implementation of the paper: P. Mercado, F. Tudisco, and M. Hein,

Pedro Mercado 6 May 26, 2022
AbelNN: Deep Learning Python module from scratch

AbelNN: Deep Learning Python module from scratch I have implemented several neural networks from scratch using only Numpy. I have designed the module

Abel 2 Apr 12, 2022