Coder Social home page Coder Social logo

trash_classifier's Introduction

Trash Classifier

Motivation for this Project

Being able to sort trash according to different materials is very important for recycling. However, sorting trash is one of the toughest tasks to do. While it is easy to sort metals and non-metals, it is very difficult to sort paper, glass, plastic and cardboard.

Currently, it is done by people. It is not a good job and such people are often at danger of being exposed to harmful chemicals, medical wastes and be exposed to diseases. If instead we can use a neural network that can do the classification then we can make the process faster, safer and more accurate.

This project attempts to use a convolutional neural network to do just that.

Edge Computing

It is not always possible to run a machine learning model on a GPU as there can be cost and space restrictions. And always making an API call can have latencies and internet might not always be available.

In these cases using small, cheap devices at the edge (where the data is generated) is the best solution.

The problem with running models on the edge is that we are limited by the amount of computation power that we have. There are many ways to overcome this. You could use a hardware accelerator like a Neural Computer Stick. Or you could use some models that are built specifically to not be computationally expensive and run on the edge.

In this project we use the UP Embedded Vision Kit to run inference on the edge. We use the mobilenet model which is computationally less expensive.

Project Structure

  • mobilenet_training.py: You can use this script to train the model.
  • trash_classifier.py: The script to classify trash on the UP Board Embedded kit.
  • prediction_images: Directory Containing the predicted images.
  • models: The saved model is here

Data

The data for this project was collected from the trashnet project

Training

Sample code for training

python3 mobilenet_training.py --nb_epoch 2 --batch_size 32 --model models/model1.h5

Classification

Sample code for classification.

Note: This will run only with the basler camera.

python3 trash_classifier.py

Requirements

This project requires python3.6 and opencv. Other requirements are present in the requirements.txt file.

trash_classifier's People

Contributors

soham96 avatar varchanaiyer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.