← Back to Blog

Classifying Waste with a Hybrid Deep Learning Approach

Waste management is one of those problems that sounds simple until you try to automate it. We all know which bin something goes into — until a machine has to figure it out from a photo. For my SEDS536 Image Understanding term project, I built a system that does exactly that: classifying waste images into six categories using a hybrid approach that blends traditional computer vision with deep learning.

The Problem

Recycling facilities still rely heavily on manual sorting. It's slow, error-prone, and doesn't scale. The idea was straightforward — given an image of a piece of waste, can a model reliably tell you if it's cardboard, glass, metal, paper, plastic, or trash?

I used the TrashNet dataset: 2,527 images across those six categories. Not huge, but enough to test whether a smart feature extraction strategy could compensate for limited data.

Why a Hybrid Approach?

Most projects in this space go all-in on deep learning. I wanted to see what happens when you combine the old with the new.

By concatenating HOG's 8,100-dimensional vector with ResNet's 2,048-dimensional features, I got a combined 10,148-dimensional representation that feeds into an SVM classifier. The hypothesis was simple: two perspectives are better than one.

Did It Work?

I tested four approaches side by side:

ApproachAccuracy
HOG + SVM (baseline)62.50%
MobileNetV2 + SVM80.00%
ResNet-50 + SVM84.17%
Hybrid (HOG + ResNet) + SVM85.00%

The hybrid model came out on top. The improvement over ResNet alone is modest, but it confirms that traditional features still carry useful information that deep networks might overlook — especially edge and texture patterns that matter for distinguishing materials.

Some categories were trickier than others. Cardboard hit 95% recall, while glass and plastic kept getting confused with each other — which makes sense when both are transparent and reflective.

From Notebook to Web App

A model sitting in a Jupyter notebook doesn't help anyone sort their recycling. So I wrapped the whole pipeline into a Flask web application with drag-and-drop image upload, real-time classification, confidence scores for all categories, and recycling tips based on the prediction.

The app loads the trained hybrid model, extracts both HOG and ResNet features from the uploaded image, and returns a prediction in seconds.

Key Takeaways

  1. Hybrid features work. Combining traditional and deep learning features consistently outperformed either approach alone.
  2. Transfer learning is powerful with small datasets. ResNet pre-trained on ImageNet carried most of the weight — fine-tuning wasn't even necessary.
  3. Material similarity is the real challenge. The hardest classifications weren't random errors — they were visually similar materials like glass vs. plastic and cardboard vs. paper.

This project reinforced something I keep coming back to: the best solutions often come from combining different perspectives rather than betting everything on one approach.

For those interested in the methodology, evaluation metrics, and academic references, the full project report is available here: Project Report

You can also explore the full source code on GitHub: GitHub Repository