An intelligent, state-of-the-art dual-model waste classification system that utilizes deep learning and computer vision to classify waste items from images or in real-time using a webcam.
This robust system has been completely retooled to execute simultaneous, dual-inference predictions across two unique MobileNetV2 neural networks—providing you with both a highly specific material class and a broad ecological category at a single glance.
Note: The accuracy of the waste classification may currently vary depending on lighting conditions or complex backgrounds. We are constantly improving our datasets to enhance accuracy in future updates.
- 🚀 Dual Model Architecture: Simultaneously predicts specific material types and broad categories.
- 💻 Multiple Interfaces: Choose between a modern UI Web Dashboard, Live YOLOv8 Webcam Tracking, or Terminal Drag-n-Drop inference.
- ⚡ Real-Time Speeds: Sub-second prediction times powered by MobileNetV2 Transfer Learning.
Our sleek, glassmorphic Flask web interface allows anyone to upload pictures right from their browser and receive an instant breakdown.
Modern web application calculating both metrics simultaneously.
Run the live classification script to detect waste in real-time. It uses YOLO to draw a dynamic bounding box, then crops and feeds the object into both neural networks continuously!
Live webcam interface showing dual overlays.
A lightning fast terminal module. Drop an image into your terminal and let the engines decode it instantly.
The system is powered by two distinct Convolutional Neural Networks based on MobileNetV2. We use Transfer Learning to freeze foundational layers while fine-tuning the heads across specific domains:
Located in multiclass_model/, this engine classifies items into 12 distinct material categories:
- Battery, Biological, Brown Glass, Cardboard, Clothes, Green Glass, Metal, Paper, Plastic, Shoes, Trash (Miscellaneous), White Glass.
Located in binary_model/, this localized intelligence sorts inputs broadly to aid recycling operations:
- ORGANIC
- RECYCLABLE
Both models operate automatically and simultaneously across all application fronts.
Follow these instructions to set up the project on your local machine.
git clone https://github.com/Yashraj-Jangra/waste-segregation-project.git
cd waste-segregation-projectWindows:
python -m venv venv
.\venv\Scripts\activatemacOS / Linux:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython app.py- Navigate to
http://localhost:5000(orhttp://127.0.0.1:5000). - Use the modern drag-and-drop dashboard to analyze static images instantly.
python live_classifier.py- A window opens with your webcam feed.
- YOLOv8 scans the feed and snaps a bounding box over central objects.
- Both models analyze the box and hover the predictions directly above the object.
- Press 'q' to close the window.
Classify a static image directly from the terminal or using Drag & Drop.
python image_classifier.py- A prompt asks for an image path. Drag and drop
.jpgor.pngfiles natively. - Output is beautifully structured via a console table and an OpenCV window.
.
├── app.py # Flask web application server integrating both models
├── binary_model/ # Home of the 2-Class Network (Organic vs Recyclable)
│ ├── DATASET/ # Localized training imagery
│ ├── train_binary_model.py # Standalone MobileNetV2 compiler & trainer
│ └── waste_binary_classifier_model.h5
├── image_classifier.py # CLI Inference (Supports Drag & Drop)
├── live_classifier.py # Webcam YOLOv8 Object Tracking
├── multiclass_model/ # Home of the primary 12-Class Network
│ ├── dataset-2/ # Foundational bulk imagery
│ ├── prepare_model.py # Architectural blueprints
│ ├── train_model.py # Multiclass Model compiler & trainer
│ └── waste_classifier_model.h5
├── requirements.txt # Essential Python packages needed to run inference
├── screenshots/ # Documentation visual assets
├── templates/ # Raw HTML, CSS (Glassmorphism layout) & JS files
└── uploads/ # Temporary container for active web transmissions
Developed with Python, TensorFlow, OpenCV & Ultralytics.
