EcoSort AI is a smart waste classification system powered by Artificial Intelligence. It uses Deep Learning (MobileNetV2) to accurately classify different types of waste, helping users sort trash effectively for recycling and proper disposal.
The application features a modern web interface built with Flask, allowing users to upload images, use their camera for real-time detection, or process batches of images.
- AI-Powered Classification: Classifies waste into 7 categories:
- 📦 Cardboard
- 🔌 E-waste
- 🍶 Glass
- 🏥 Medical
- 🥫 Metal
- 📄 Paper
- 🔄 Plastic
- Multiple Input Methods:
- 📸 Camera Capture: Real-time classification using your device's camera.
- 📤 Single Upload: Drag and drop images for instant analysis.
- 📚 Batch Processing: Upload multiple images at once for bulk classification.
- 🎥 Live Detection: Real-time video stream analysis with Grad-CAM visualization (heatmaps).
- Detailed Analytics: Track classification history and export reports (CSV/PDF).
- Educational Insights: Provides recycling tips and disposal guidelines for each category.
- Backend: Python 3.11, Flask
- Machine Learning: TensorFlow, Keras (MobileNetV2 Transfer Learning)
- Image Processing: Pillow (PIL), NumPy
- Frontend: HTML5, CSS3, JavaScript
EcoSort-AI/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── STARTUP.txt # Quick startup guide
├── models/ # Directory for trained models (.keras)
├── static/ # CSS, JS, and images
├── templates/ # HTML templates
├── uploads/ # Temporary storage for uploaded images
└── scripts/ # Utility scripts for data processing & training
├── clean_dataset.py
├── split_data.py
└── train_trashformer.py
This project uses the TrashBox dataset.
- Source: TrashBox Dataset on GitHub
- Categories: Cardboard, E-waste, Glass, Medical, Metal, Paper, Plastic.
- Python 3.11 or higher
- Git
-
Clone the Repository
git clone https://github.com/Susreel7/EcoSort-AI.git cd EcoSort-AI -
Create a Virtual Environment (Recommended)
# Windows python -m venv venv venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Start the Application
python app.py
-
Access the Web Interface Open your web browser and navigate to:
http://localhost:5000
If you want to train the model yourself:
-
Prepare Data:
- Download the dataset and place it in a
waste_datafolder one level up from the project directory (../waste_data). - Ensure folders are named:
cardboard,glass,metal,paper,plastic,trash, etc.
- Download the dataset and place it in a
-
Split Data:
python scripts/split_data.py
-
Clean Dataset (Optional but recommended):
python scripts/clean_dataset.py
-
Train Model:
python scripts/train_trashformer.py
The trained model will be saved in the
models/directory.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.