Demo: Watch on YouTube
RecycleNet is a deep learning-based solution for promoting effective recycling practices. The project combines an image classification model, capable of categorizing recyclable items into 30 distinct classes, with an interactive chatbot that guides users on proper recycling methods.
RecycleNet identifies items as one of 30 recyclable categories, including:
Recyclable Items | Recyclable Items |
---|---|
Aerosol Cans | Plastic Detergent Bottles |
Aluminum Food Cans | Plastic Food Containers |
Aluminum Soda Cans | Plastic Shopping Bags |
Cardboard Boxes | Plastic Soda Bottles |
Cardboard Packaging | Plastic Straws |
Clothing | Plastic Trash Bags |
Coffee Grounds | Plastic Water Bottles |
Disposable Plastic Cutlery | Shoes |
Eggshells | Steel Food Cans |
Food Waste | Styrofoam Cups |
Glass Beverage Bottles | Styrofoam Food Containers |
Glass Cosmetic Containers | Tea Bags |
Glass Food Jars | Magazines |
Newspaper | Office Paper |
Paper Cups | Plastic Cup Lids |
- Interactive Assistance: Provides clear instructions on how to recycle items.
- Educational Content: Shares best practices and explains the recycling process for different materials.
- User-Friendly Interface: Ensures accessibility with intuitive interaction.
- Upload an Image: Upload an image of the item you wish to recycle.
- Get Classification: The system identifies the item category and provides a confidence score.
- Receive Guidance: The chatbot delivers step-by-step instructions for recycling, including any region-specific considerations.
- The classification model is based on ResNet18 and fine-tuned on a dataset of recyclable items.
- It achieves high accuracy with normalized ImageNet weights and a custom prediction head.
The classify()
function:
- Takes image bytes as input.
- Processes the image using transformations (resize, crop, normalize).
- Returns the predicted class, its index, and confidence score.
- Built using Google's GEMMA-1.1-2b and fine-tuned with LoRA for better context understanding in recycling-related queries.
- Supports interactive chat sessions to deliver detailed recycling instructions.
Developed using FastAPI to provide endpoints for:
- Health Check: Verify API availability (
/health
). - Upload Endpoint: Upload an image and receive classification details along with metadata (
/upload
).
- Backend: FastAPI
- Modeling: PyTorch, HuggingFace Transformers
- Preprocessing: torchvision
- Deployment: Docker-ready for easy scaling
-
Clone Repository
git clone https://github.com/yourusername/recyclenet.git cd recyclenet
-
Install Dependencies
pip install -r requirements.txt
-
Run Locally
uvicorn app.main:app --reload
-
Access API
Open http://127.0.0.1:8000/docs for interactive API documentation.
- Expand Classification Categories: Incorporate more recyclable materials.
- Localization: Support region-specific recycling rules.
- Advanced Chatbot Features: Improve interaction for more personalized guidance.
This project is licensed under the MIT License.