An intelligent waste‑segregation system leveraging deep learning to promote sustainability and responsible recycling.
EcoClassify is an AI‑powered image classification system that automatically identifies different types of garbage and recommends the correct disposal bin along with recycling guidance. The system is built using Convolutional Neural Networks (CNNs) and deployed through a clean, interactive Gradio web interface.
The goal of this project is to assist individuals and organizations in improving waste segregation efficiency, reducing environmental impact, and encouraging sustainable practices.
- 🧠 Garbage Classification – Classifies waste into 12 distinct categories
- 🔬 Multi‑Model Evaluation – Comparative study of ResNet50, MobileNetV2, and Random Forest
- 🌐 Web Application – Simple and intuitive UI powered by Gradio
- 🗑️ Smart Recycling Guidance – Displays bin color + disposal instructions for each prediction
- 📈 High Accuracy – Final ResNet50 model achieved 99.08% test accuracy
| Model | Test Accuracy | Validation Accuracy |
|---|---|---|
| ResNet50 ⭐ | 99.08% | 99.58% |
| MobileNetV2 | 90.81% | 92.89% |
| Random Forest | 85.34% | N/A |
✔️ ResNet50 was selected for deployment due to its superior and consistent performance.
The project follows a modular and reproducible pipeline:
-
📂 Data Splitting
split_dataset.pydivides the dataset into:- Training: 70%
- Validation: 15%
- Testing: 15%
-
🏋️ Model Training
train_resnet50.pyfine‑tunes a pre‑trained ResNet50 model on the garbage dataset. -
🔍 Feature Extraction (Alternative Path)
extract_features.pyextracts deep features using ResNet50train_rf_classifier.pytrains a Random Forest classifier on those features
-
📊 Evaluation Evaluation scripts generate:
- Accuracy scores
- Confusion matrices
- Classification reports
-
🌐 Web App Deployment
gradio_resnet_app.pydeploys the best‑performing model using Gradio.
git clone https://github.com/yatharth1511/EcoClassify.git
cd EcoClassifypip install -r requirements.txtpython gradio_resnet_app.py- 📤 Upload an image of a waste item
- 🧠 Model predicts the garbage category
- 🗑️ Recommended bin is displayed
- ♻️ Recycling guidance is shown for proper disposal
| Bin Color | Waste Categories | Description |
|---|---|---|
| 🟩 Green Bin | Biological, Paper, Cardboard | Organic & biodegradable waste |
| 🟦 Blue Bin | Plastic, Metal | Recyclable materials |
| ⬜ White Bin | Green‑Glass, Brown‑Glass, White‑Glass | Glass waste |
| 🟧 Orange Bin | Clothes, Shoes | Textile waste |
| 🟥 Red Bin | Trash, Battery | General & hazardous waste |
Overall Test Accuracy: 99% Test Samples: 1197
| Class | Precision | Recall | F1‑Score | Support |
|---|---|---|---|---|
| Battery | 0.99 | 0.99 | 0.99 | 101 |
| Biological | 1.00 | 1.00 | 1.00 | 101 |
| Brown‑Glass | 1.00 | 0.99 | 0.99 | 92 |
| Cardboard | 0.98 | 0.96 | 0.97 | 101 |
| Clothes | 1.00 | 0.99 | 1.00 | 101 |
| Green‑Glass | 1.00 | 0.99 | 0.99 | 95 |
| Metal | 0.95 | 0.99 | 0.97 | 101 |
| Paper | 0.99 | 0.99 | 0.99 | 101 |
| Plastic | 0.99 | 0.99 | 0.99 | 101 |
| Shoes | 1.00 | 1.00 | 1.00 | 101 |
| Trash | 1.00 | 1.00 | 1.00 | 101 |
| White‑Glass | 0.99 | 1.00 | 1.00 | 101 |
The results_resnet50/ directory contains:
- Confusion matrices
- Classification reports
- Accuracy logs
- Integration with smart bins
- Real‑time classification via mobile camera
- Dataset expansion for regional waste categories
- Lightweight deployment for edge devices
- Yatharth Sharma
- Vansh Garg
This project is licensed under the MIT License.
⭐ If you found this project useful, feel free to star the repository and contribute!
This is to check that ai review work or not ]
checking garbage is properly classified or not