Inspiration

Picture a greasy pizza box in one hand and a crushed can in the other, standing over a row of bins. Blue for dry waste, green for wet. You hesitate. Then you guess.

That small hesitation happens countless times a day, in kitchens, offices, and hostels. Many Indian cities ask households to separate dry and wet waste, yet most people never learn exactly where each item belongs. Every wrong guess has a cost: one soiled item can contaminate a whole bag of recyclables, and good material ends up as landfill. The problem isn't that people don't care. It's that the decision is confusing and has to be made in a second, with nobody to ask.

We wanted to take the hesitation away. Point a camera at the pile, and get the answer back.

What it does

WasteWise AI looks at a photo of waste and tells you what it sees.

  • See. Upload an image, and the model detects waste items and classifies them as biodegradable, cardboard, glass, metal, paper, or plastic.
  • Show confidence. Every prediction comes with a confidence score, so you know how much to trust it.
  • Guide. Each category maps to a disposal bin, dry/recyclable or wet/compost, so the result is an action, not just a label.

How we built it

The data. We trained on the Trash Detection Dataset from Mendeley Data, which has six classes: biodegradable, cardboard, glass, metal, paper, and plastic.

The model. We fine-tuned a small YOLOv8 model (yolov8n) for 15 epochs at \(640 \times 640\) resolution on a free Colab GPU. Small on purpose: it's fast and light enough to run on a modest machine.

The runtime. After training, we exported the model to ONNX so it can be loaded with OpenCV, which handles the image processing around it.

The interface. A Streamlit web app lets anyone upload a photo and see the prediction and confidence in the browser.

How we measured it

A detection counts as correct when its box overlaps the true box enough. Overlap is measured as intersection over union:

$$ \mathrm{IoU} = \frac{|A \cap B|}{|A \cup B|} $$

A prediction is a hit when \(\mathrm{IoU} \ge 0.5\). From the hits and misses we compute precision and recall:

$$ P = \frac{TP}{TP + FP}, \qquad R = \frac{TP}{TP + FN} $$

and \(\mathrm{mAP}_{50}\), the average over classes of the area under each precision-recall curve.

On a held-out validation set of 1,008 images containing 7,284 objects:

Class Precision Recall mAP50
All classes 0.678 0.488 0.556
Glass 0.706 0.696 0.742
Metal 0.688 0.550 0.642
Cardboard 0.540 0.532 0.536
Biodegradable 0.788 0.373 0.513
Plastic 0.631 0.425 0.486
Paper 0.712 0.352 0.416

The pattern is clear. When the model speaks, it's right about two times in three (\(P \approx 0.68\)). But it stays silent on about half of the objects (\(R \approx 0.49\)). Glass is its strongest class, and paper is its weakest.

Challenges we ran into

The data fought back.

  • Our first dataset choice had no download option, so we switched to a new one in YOLO format.
  • A label check turned up 1,166 lines that weren't valid boxes, many of them polygons. We converted each polygon to its enclosing rectangle, kept a backup of the original, and checked again until the count was zero.
  • The dataset's config file still pointed to folders that no longer existed after we moved the data, and a folder name with spaces broke the paths. We rewrote them while keeping the class order exactly as it was, because one swapped label would quietly ruin every result.

Files that vanished and reappeared. The trained model was sitting in Colab but didn't show in the file panel. We found it with a command and downloaded it with code.

Crowded scenes. Some validation images hold up to 311 objects. In a heap of mixed, overlapping waste, the model misses many items, and our first app version showed only the single highest-confidence detection, which made a whole pile look like one item.

The unglamorous setup work. Getting Git recognised in the terminal and pushing a project to GitHub for the first time took longer than any single model run. This was our first end-to-end machine learning project, so every step was a small discovery.

Accomplishments that we're proud of

  • Built a complete pipeline end to end, from a raw dataset to a working web app, as a first machine learning project.
  • Found and repaired 1,166 bad labels instead of training on data we didn't trust.
  • Reached \(\mathrm{mAP}_{50} = 0.556\) on 1,008 validation images with a small model trained for just 15 epochs, and 0.742 on glass.
  • Reported our results honestly, including the weakest classes and the limits of the model on crowded scenes.

What we learned

  • Data decides. A pretrained detector has never heard of "plastic waste." The right labelled data matters more than a bigger model, and checking label formats before training saved us from silent failures.
  • One number never tells the whole story. A model can look precise (\(P \approx 0.68\)) and still miss half of what's in the picture (\(R \approx 0.49\)).
  • Real photos are messier than datasets. A pile of mixed waste exposed limits that validation numbers hid.
  • Small can ship. ONNX plus OpenCV gives a compact app that doesn't need a heavy framework to run.

What's next for Wastewise_AI

  • Mixed and overlapping waste. Train a larger model for longer, on more crowded scenes.
  • Show every item. Display all detections in a photo with a per-item bin recommendation.
  • Local rules. Recycling guidance specific to each city, in more languages.
  • Voice guidance for people who can't read the screen.
  • Smart bins. Connect the detector to a camera on a real bin, and eventually to a sorting mechanism.
  • Learn from corrections. Let users fix wrong answers, and use those fixes to improve the model.

Built with

Python, YOLOv8 (Ultralytics), ONNX, OpenCV, Streamlit, Google Colab, GitHub.

Dataset credit: Trash Detection Dataset, Mendeley Data (https://data.mendeley.com/datasets/z732f9pwxt).

Built With

Share this project:

Updates

Submission history