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
Exploring Versatile Prior for Human Motion via Motion Frequency Guidance (3DV2021)

Exploring Versatile Prior for Human Motion via Motion Frequency Guidance This is the codebase for video-based human motion reconstruction in human-mot

Jiachen Xu 5 Jul 14, 2022
TraND: Transferable Neighborhood Discovery for Unsupervised Cross-domain Gait Recognition.

TraND This is the code for the paper "Jinkai Zheng, Xinchen Liu, Chenggang Yan, Jiyong Zhang, Wu Liu, Xiaoping Zhang and Tao Mei: TraND: Transferable

Jinkai Zheng 32 Apr 04, 2022
Histocartography is a framework bringing together AI and Digital Pathology

Documentation | Paper Welcome to the histocartography repository! histocartography is a python-based library designed to facilitate the development of

155 Nov 23, 2022
Rainbow DQN implementation that outperforms the paper's results on 40% of games using 20x less data 🌈

Rainbow 🌈 An implementation of Rainbow DQN which reaches a median HNS of 205.7 after only 10M frames (the original Rainbow from Hessel et al. 2017 re

Dominik Schmidt 31 Dec 21, 2022
Using multidimensional LSTM neural networks to create a forecast for Bitcoin price

Multidimensional LSTM BitCoin Time Series Using multidimensional LSTM neural networks to create a forecast for Bitcoin price. For notes around this co

Jakob Aungiers 318 Dec 14, 2022
An open-source project for applying deep learning to medical scenarios

Auto Vaidya An open source solution for creating end-end web app for employing the power of deep learning in various clinical scenarios like implant d

Smaranjit Ghose 18 May 29, 2022
Boosted neural network for tabular data

XBNet - Xtremely Boosted Network Boosted neural network for tabular data XBNet is an open source project which is built with PyTorch which tries to co

Tushar Sarkar 175 Jan 04, 2023
A simple interface for editing natural photos with generative neural networks.

Neural Photo Editor A simple interface for editing natural photos with generative neural networks. This repository contains code for the paper "Neural

Andy Brock 2.1k Dec 29, 2022
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation.

ENet This work has been published in arXiv: ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation. Packages: train contains too

e-Lab 344 Nov 21, 2022
Megaverse is a new 3D simulation platform for reinforcement learning and embodied AI research

Megaverse Megaverse is a new 3D simulation platform for reinforcement learning and embodied AI research. The efficient design of the engine enables ph

Aleksei Petrenko 191 Dec 23, 2022
Pytorch implementation of "Grad-TTS: A Diffusion Probabilistic Model for Text-to-Speech"

GradTTS Unofficial Pytorch implementation of "Grad-TTS: A Diffusion Probabilistic Model for Text-to-Speech" (arxiv) About this repo This is an unoffic

HeyangXue1997 103 Dec 23, 2022
A Distributional Approach To Controlled Text Generation

A Distributional Approach To Controlled Text Generation This is the repository code for the ICLR 2021 paper "A Distributional Approach to Controlled T

NAVER 102 Jan 07, 2023
本步态识别系统主要基于GaitSet模型进行实现

本步态识别系统主要基于GaitSet模型进行实现。在尝试部署本系统之前,建立理解GaitSet模型的网络结构、训练和推理方法。 系统的实现效果如视频所示: 演示视频 由于模型较大,部分模型文件存储在百度云盘。 链接提取码:33mb 具体部署过程 1.下载代码 2.安装requirements.txt

16 Oct 22, 2022
MonoScene: Monocular 3D Semantic Scene Completion

MonoScene: Monocular 3D Semantic Scene Completion MonoScene: Monocular 3D Semantic Scene Completion] [arXiv + supp] | [Project page] Anh-Quan Cao, Rao

298 Jan 08, 2023
Code to produce syntactic representations that can be used to study syntax processing in the human brain

Can fMRI reveal the representation of syntactic structure in the brain? The code base for our paper on understanding syntactic representations in the

Aniketh Janardhan Reddy 4 Dec 18, 2022
Dados coletados e programas desenvolvidos no processo de iniciação científica

Iniciacao_cientifica_FAPESP_2020-14845-6 Dados coletados e programas desenvolvidos no processo de iniciação científica Os arquivos .py são os programa

1 Jan 10, 2022
Powerful and efficient Computer Vision Annotation Tool (CVAT)

Computer Vision Annotation Tool (CVAT) CVAT is free, online, interactive video and image annotation tool for computer vision. It is being used by our

OpenVINO Toolkit 8.6k Jan 01, 2023
Based on the given clinical dataset, Predict whether the patient having Heart Disease or Not having Heart Disease

Heart_Disease_Classification Based on the given clinical dataset, Predict whether the patient having Heart Disease or Not having Heart Disease Dataset

Ashish 1 Jan 30, 2022
ZeroGen: Efficient Zero-shot Learning via Dataset Generation

ZEROGEN This repository contains the code for our paper “ZeroGen: Efficient Zero

Jiacheng Ye 31 Dec 30, 2022
Code for the upcoming CVPR 2021 paper

The Temporal Opportunist: Self-Supervised Multi-Frame Monocular Depth Jamie Watson, Oisin Mac Aodha, Victor Prisacariu, Gabriel J. Brostow and Michael

Niantic Labs 496 Dec 30, 2022