Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,3 +11,160 @@ license: mit
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# 🌱 EcoScan - AI-Powered Waste Sorting Classifier
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+

|
| 25 |
+

|
| 26 |
+

|
| 27 |
+
|
| 28 |
+
An intelligent waste classification system that helps promote smart recycling and sustainability through AI-powered image recognition.
|
| 29 |
+
|
| 30 |
+
## 🎯 Features
|
| 31 |
+
|
| 32 |
+
- **🔍 Real-time Classification**: Upload waste images and get instant predictions
|
| 33 |
+
- **📊 Confidence Scores**: See top-3 predictions with confidence percentages
|
| 34 |
+
- **🔥 Explainable AI**: Grad-CAM visualization shows what the model focuses on
|
| 35 |
+
- **♻️ Recycling Guidance**: Get specific tips for each material type
|
| 36 |
+
- **🌍 Environmental Impact**: Learn decomposition times and eco-scores
|
| 37 |
+
- **📱 Easy to Use**: Clean, intuitive Gradio interface
|
| 38 |
+
|
| 39 |
+
## 🗂️ Supported Categories
|
| 40 |
+
|
| 41 |
+
| Category | Icon | EcoScore | Decomposition Time |
|
| 42 |
+
|----------|------|----------|-------------------|
|
| 43 |
+
| Cardboard | 📦 | 9/10 | 2-3 months |
|
| 44 |
+
| Glass | 🥃 | 8/10 | 1 million years |
|
| 45 |
+
| Metal | 🔩 | 9/10 | 50-500 years |
|
| 46 |
+
| Paper | 📄 | 8/10 | 2-6 weeks |
|
| 47 |
+
| Plastic | 🧴 | 4/10 | 450-1000 years |
|
| 48 |
+
| General Waste | 🗑️ | 3/10 | Variable |
|
| 49 |
+
|
| 50 |
+
## 🚀 Quick Start
|
| 51 |
+
|
| 52 |
+
### Installation
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
# Clone the repository
|
| 56 |
+
git clone https: https://github.com/AyobamiMichael/EcoScanAIwasteClassifier.git
|
| 57 |
+
cd ecoscan
|
| 58 |
+
|
| 59 |
+
# Install dependencies
|
| 60 |
+
pip install -r requirements.txt
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### Project Structure
|
| 64 |
+
|
| 65 |
+
```
|
| 66 |
+
ecoscan/
|
| 67 |
+
├── app.py # Main Gradio application
|
| 68 |
+
├── requirements.txt # Python dependencies
|
| 69 |
+
├── README.md # This file
|
| 70 |
+
├── model/
|
| 71 |
+
│ ├── ecoscan_model.pth # Trained model weights
|
| 72 |
+
│ └── class_names.json # Class label mappings
|
| 73 |
+
└── examples/ # Sample images (optional)
|
| 74 |
+
├── plastic_bottle.jpg
|
| 75 |
+
├── cardboard_box.jpg
|
| 76 |
+
└── glass_jar.jpg
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
### Running Locally
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
python app.py
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
Then open your browser to `http://localhost:7860`
|
| 86 |
+
|
| 87 |
+
## 🧠 Model Details
|
| 88 |
+
|
| 89 |
+
- **Architecture**: EfficientNet-B3
|
| 90 |
+
- **Input Size**: 300x300 pixels
|
| 91 |
+
- **Training Dataset**: TrashNet + Custom curated data (~2,500 images)
|
| 92 |
+
- **Accuracy**: 90%+ on test set
|
| 93 |
+
- **Framework**: PyTorch
|
| 94 |
+
- **Inference Time**: <2 seconds per image
|
| 95 |
+
|
| 96 |
+
## 🔧 Technical Stack
|
| 97 |
+
|
| 98 |
+
| Component | Technology |
|
| 99 |
+
|-----------|-----------|
|
| 100 |
+
| Deep Learning | PyTorch 2.0+ |
|
| 101 |
+
| Model Architecture | EfficientNet-B3 |
|
| 102 |
+
| Web Framework | Gradio 4.0+ |
|
| 103 |
+
| Computer Vision | OpenCV, Torchvision |
|
| 104 |
+
| Explainability | Grad-CAM |
|
| 105 |
+
|
| 106 |
+
## 📊 Performance Metrics
|
| 107 |
+
|
| 108 |
+
- **Overall Accuracy**: 90.2%
|
| 109 |
+
- **Precision**: 89.5%
|
| 110 |
+
- **Recall**: 90.1%
|
| 111 |
+
- **F1-Score**: 89.8%
|
| 112 |
+
|
| 113 |
+
## 🌐 Deployment
|
| 114 |
+
|
| 115 |
+
### Hugging Face Spaces
|
| 116 |
+
|
| 117 |
+
1. Create a new Space on [Hugging Face](https://huggingface.co/spaces)
|
| 118 |
+
2. Select Gradio as the SDK
|
| 119 |
+
3. Upload all files from this repository
|
| 120 |
+
4. Your app will automatically deploy!
|
| 121 |
+
|
| 122 |
+
### Docker (Optional)
|
| 123 |
+
|
| 124 |
+
```dockerfile
|
| 125 |
+
FROM python:3.10-slim
|
| 126 |
+
|
| 127 |
+
WORKDIR /app
|
| 128 |
+
|
| 129 |
+
COPY requirements.txt .
|
| 130 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 131 |
+
|
| 132 |
+
COPY . .
|
| 133 |
+
|
| 134 |
+
EXPOSE 7860
|
| 135 |
+
|
| 136 |
+
CMD ["python", "app.py"]
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
## 💡 Usage Tips
|
| 140 |
+
|
| 141 |
+
1. **Best Results**: Use well-lit, clear images with minimal background clutter
|
| 142 |
+
2. **Multiple Items**: For best accuracy, photograph one item at a time
|
| 143 |
+
3. **Angle**: Capture the item from a recognizable angle
|
| 144 |
+
4. **Distance**: Fill at least 50% of the frame with the waste item
|
| 145 |
+
|
| 146 |
+
## 🤝 Contributing
|
| 147 |
+
|
| 148 |
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
| 149 |
+
|
| 150 |
+
## 📄 License
|
| 151 |
+
|
| 152 |
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
| 153 |
+
|
| 154 |
+
## 🙏 Acknowledgments
|
| 155 |
+
|
| 156 |
+
- Dataset: TrashNet by Gary Thung and Mindy Yang
|
| 157 |
+
- Model Architecture: EfficientNet by Google Research
|
| 158 |
+
- Framework: PyTorch by Meta AI
|
| 159 |
+
- Interface: Gradio by Hugging Face
|
| 160 |
+
|
| 161 |
+
## 📧 Contact
|
| 162 |
+
|
| 163 |
+
For questions or feedback, please open an issue or reach out via email.
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
<div align="center">
|
| 168 |
+
<p>Built with ❤️ for a sustainable future</p>
|
| 169 |
+
<p>⭐ Star this repo if you find it useful!</p>
|
| 170 |
+
</div>
|