Skip to content

Raghavsk24/EcoBin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcoBin

EcoBin is an AI-powered waste classification platform that helps people sort their waste correctly and learn better recycling habits. Waste is a massive problem. In the United States alone, over 292 million tons of waste are generated each year, and that number is expected to double by 2050. Yet less than a third of our waste stream is actually recycled, largely because roughly a quarter of what ends up in recycling bins doesn't belong there.

EcoBin addresses this by using computer vision to automatically identify and categorize waste with ~95% accuracy. It explains every prediction with a Grad-CAM heatmap, learns from your corrections, and includes a flashcard quiz with over 100 questions to help people test and build their recycling knowledge.

Live app: https://eco-bin-sepia.vercel.app/

Research Paper DOI: https://arxiv.org/abs/2606.15547v1

Kaggle notebook: https://www.kaggle.com/code/ragbag84/ecobin-two-stage-waste-classification-pipeline

Tech stack

Frontend

Next.js React TypeScript Tailwind CSS

Backend

Python FastAPI TensorFlow Keras

Infrastructure

Vercel HuggingFace Docker

Classification Pipeline

EcoBin uses a single-stage EfficientNet-B0 image classifier. Given one photo it predicts which of 30 household-waste classes the item belongs to and maps that class to one of three disposal pathways — Recycling, Compost, or Garbage. Images are fed to the model as raw 0-255 RGB pixels resized to 224×224 (EfficientNet-B0 normalizes internally), and the model returns the top class plus its softmax confidence. There is no contamination check — recyclable items are simply classified as Recycling.

The classifier is served by a FastAPI app on a HuggingFace Space and exposes three endpoints:

  • GET /health — liveness/warmth probe.
  • POST /predict — image → { item, pathway, confidence, low_confidence, gradcam, prediction_id, corrected_by_memory, ... }.
  • POST /feedback{ prediction_id, correct_item } → stores a user correction.

Class → pathway map

Each of the 30 classes maps to one of three pathways:

Pathway Classes
Recycling aerosol_cans, aluminum_food_cans, aluminum_soda_cans, steel_food_cans, cardboard_boxes, cardboard_packaging, glass_beverage_bottles, glass_cosmetic_containers, glass_food_jars, plastic_detergent_bottles, plastic_soda_bottles, plastic_water_bottles, plastic_food_containers, newspaper, office_paper, magazines, paper_cups
Garbage styrofoam_cups, styrofoam_food_containers, plastic_shopping_bags, plastic_straws, plastic_cup_lids, plastic_trash_bags, disposable_plastic_cutlery, clothing, shoes
Compost food_waste, coffee_grounds, eggshells, tea_bags

Grad-CAM explainability

Every prediction returns a Grad-CAM overlay: the gradient of the predicted-class score with respect to the backbone's last convolutional feature map is pooled, ReLU'd, upsampled to 224×224, colored with a JET colormap, and alpha-blended over the original frame. The result is returned as a base64 PNG so the UI can show exactly what region of the image drove the classification.

Correction memory (learning from mistakes)

When the model is wrong, the user can type the correct item. Rather than back-propagating into the CNN on a single example (which risks catastrophic forgetting), EcoBin stores the image's 1280-d embedding alongside the correct label in a tiny cosine-similarity memory. On every future prediction, the new image's embedding is compared against this memory; if it is very close to a stored correction, the model's guess is overridden and the result is flagged corrected_by_memory. This learns instantly, never touches the model weights, and persists to disk.

Features

The app offers two features to help users make better disposal decisions.

  1. The first is a free AI tool in the Scan Waste Item tab. You take a photo of the item you want to dispose of and EcoBin runs its EfficientNet-B0 classifier to identify the object, show a Grad-CAM heatmap of what it looked at, report its confidence (flagging low-confidence predictions), and tell you how to dispose of it. If it gets something wrong, you can correct it and EcoBin remembers so it won't repeat the mistake.

  2. The second is the Quiz Yourself tab. We have over 100 flashcards in our database covering a wide range of waste items. Each quiz pulls up to 10 random cards and asks you to guess how each item should be disposed of: Recycling, Compost, or Garbage. After every question, you get an explanation of why your answer was right or wrong, and after all 10 you get a full results summary. You can retake the quiz up to 10 times.

About

AI-Powered Smart Bin that uses a deep convolutional neural network (EfficientNetV2-S) to autonomously sort waste items into an appropriate disposal pathway

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors