Make a Pi Trash Classifier with ML!

The Trash Classifier project, affectionately known as “Where does it go?!”, is designed to make throwing things away faster and more reliable.

This project uses a Machine Learning (ML) model trained in Lobe, a beginner-friendly (no code!) ML model builder, to identify whether an object goes in the garbage, recycling, compost, or hazardous waste. The model is then loaded onto a Raspberry Pi 4 computer to make it usable wherever you might find rubbish bins!

This tutorial walks you how to create your own Trash Classifier project on a Raspberry Pi from a Lobe TensorFlow model in Python3.

Difficulty: Beginner++ (some knowledge w/ circuits and coding is helpful)

Read Time: 5 min

Build Time: 60 – 90 min

Cost: ~$70 (including Pi 4)

Before we start

This project assumes you're starting with a fully set-up Raspberry Pi in a headless configuration. ​​Here's a beginner-friendly guide on how to do this.

It also helps to have some knowledge of the following:

1.Familiarity with the Raspberry Pi

2.Reading and editing Python code (you won't need to write a program from scratch, just edit)

3.Reading Fritzing wiring diagrams

4.Using a breadboard

Find out where your trash goes

Each city across the US (and I would assume the globe) has its own garbage/recycling/compost/etc. collection system. This means that to make an accurate trash classifier, we'll need to 1) build a custom ML model (we'll cover this in the next step — no code!) and 2) know where each piece of trash goes.

Since I didn't always know the proper bin for each item I used to train my model, I used the Seattle Utilities flyer shown above, and also this handy “Where does it go?” lookup tool for the city of Seattle! Check out what resources are available in your city you by looking up your city's garbage collection utility and perusing its website.

Create a custom ML model in Lobe

What is Lobe?

Lobe is an easy-to-use tool that has everything you need to bring your machine learning ideas to life. Show it examples of what you want it to do, and it automatically trains a custom machine learning model that can be exported for edge devices and apps. It doesn’t require any experience to get started. You can train on your own computer for free!

Here's a quick overview on how to use Lobe:

1. Open the Lobe program and create a new project.

Source: Make a Pi Trash Classifier with ML!

About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Scroll to Top