{"id":24917201,"url":"https://github.com/arpanpramanik2003/smart-waste-classification","last_synced_at":"2026-04-16T01:33:15.954Z","repository":{"id":275306812,"uuid":"925691673","full_name":"arpanpramanik2003/smart-waste-classification","owner":"arpanpramanik2003","description":"This project utilizes MobileNet and the TrashNet dataset to classify waste into different categories and provide recycling suggestions. Built with TensorFlow and Streamlit, it allows users to upload an image of trash and get instant classification results along with eco-friendly disposal recommendations.","archived":false,"fork":false,"pushed_at":"2025-10-28T07:53:11.000Z","size":63060,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T09:28:46.652Z","etag":null,"topics":["cnn-classification","deep-learning","image-classification","image-processing","imshow","keras","mobilenetv2","smart-waste","streamlit-webapp","tensorflow2","transfer-learning","trashnet"],"latest_commit_sha":null,"homepage":"https://smart-waste-arpan.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arpanpramanik2003.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-01T14:05:09.000Z","updated_at":"2025-10-28T07:53:14.000Z","dependencies_parsed_at":"2025-09-02T04:53:06.089Z","dependency_job_id":null,"html_url":"https://github.com/arpanpramanik2003/smart-waste-classification","commit_stats":null,"previous_names":["arpanpramanik2003/smart-waste-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arpanpramanik2003/smart-waste-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Fsmart-waste-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Fsmart-waste-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Fsmart-waste-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Fsmart-waste-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arpanpramanik2003","download_url":"https://codeload.github.com/arpanpramanik2003/smart-waste-classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Fsmart-waste-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31867711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn-classification","deep-learning","image-classification","image-processing","imshow","keras","mobilenetv2","smart-waste","streamlit-webapp","tensorflow2","transfer-learning","trashnet"],"created_at":"2025-02-02T08:31:43.322Z","updated_at":"2026-04-16T01:33:15.945Z","avatar_url":"https://github.com/arpanpramanik2003.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Waste Classification \u0026 Recycling Suggestion System\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![TensorFlow](https://img.shields.io/badge/TensorFlow-2.x-orange.svg)](https://www.tensorflow.org/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-1.x-red.svg)](https://streamlit.io/)\n\n## 📖 Overview\n\nA comprehensive deep learning-based solution for intelligent waste classification and recycling recommendations. This system leverages **MobileNet** architecture with transfer learning to accurately categorize different types of waste materials and provide actionable recycling suggestions, contributing to sustainable waste management practices.\n\nThe application features a user-friendly web interface built with Streamlit, enabling real-time image classification with instant recycling guidance.\n\n## ✨ Key Features\n\n- **🎯 Accurate Classification**: Deep learning model trained on the TrashNet dataset with high accuracy\n- **📸 Real-time Predictions**: Upload waste images and get instant classification results\n- **♻️ Recycling Guidance**: Detailed suggestions on proper disposal and recycling methods\n- **🖥️ Interactive Web Interface**: Clean, intuitive Streamlit-based UI for seamless user experience\n- **🚀 Production-Ready**: Containerized with Docker and deployable on cloud platforms (Fly.io, Heroku)\n- **📊 Visual Insights**: Built-in image visualization tools for better understanding\n\n## 🗂️ Project Structure\n\n```\nsmart-waste-classification/\n│\n├── app.py                 # Streamlit web application (main entry point)\n├── TrashNet.ipynb        # Jupyter notebook for model training and experimentation\n├── best_model.keras      # Trained MobileNet model (saved weights)\n├── imshow.py             # Image visualization utility functions\n│\n├── dataset.zip           # TrashNet dataset (compressed)\n│\n├── requirements.txt      # Python dependencies\n├── Dockerfile            # Docker container configuration\n├── Procfile              # Heroku deployment configuration\n├── fly.toml              # Fly.io deployment configuration\n│\n├── .gitignore            # Git ignore rules\n├── LICENSE               # MIT License\n└── README.md             # Project documentation (this file)\n```\n\n## 🗄️ Dataset\n\n### TrashNet Dataset\n\n- **Source**: [TrashNet Dataset](https://github.com/garythung/trashnet)\n- **Total Images**: 2,527 images\n- **Classes**: 6 waste categories\n  - 🥤 **Plastic** - Bottles, containers, packaging\n  - 🔧 **Metal** - Cans, foils, metal objects\n  - 🪟 **Glass** - Bottles, jars, broken glass\n  - 📄 **Paper** - Newspapers, magazines, office paper\n  - 📦 **Cardboard** - Boxes, cartons, packaging\n  - 🍎 **Organic Waste** - Food scraps, biodegradable materials\n\n### Data Preprocessing\n\n- **Image Resizing**: Standardized to 224×224 pixels (MobileNet input size)\n- **Normalization**: Pixel values scaled to [0, 1] range\n- **Data Augmentation**: \n  - Random rotation\n  - Horizontal/vertical flipping\n  - Zoom and shift transformations\n  - Brightness adjustments\n- **Train/Validation Split**: 80/20 ratio\n\n## 🏗️ Model Architecture\n\n### Base Architecture\n\n```\nMobileNetV2 (Transfer Learning)\n  ├── Input Layer: 224×224×3 RGB images\n  ├── MobileNetV2 Base: Pre-trained on ImageNet (frozen layers)\n  ├── Global Average Pooling 2D\n  ├── Dense Layer (128 units, ReLU activation)\n  ├── Dropout (0.5)\n  └── Output Layer (6 units, Softmax activation)\n```\n\n### Training Configuration\n\n- **Base Model**: MobileNetV2 (pre-trained on ImageNet)\n- **Fine-tuning Strategy**: Transfer learning with frozen base layers\n- **Optimizer**: Adam (learning rate: 0.001)\n- **Loss Function**: Categorical Cross-Entropy\n- **Metrics**: Accuracy, Precision, Recall\n- **Callbacks**: \n  - ModelCheckpoint (saves best model)\n  - EarlyStopping (patience: 10 epochs)\n  - ReduceLROnPlateau (learning rate scheduling)\n- **Training Epochs**: Variable (with early stopping)\n- **Batch Size**: 32\n\n### Model Performance\n\n- **Training Accuracy**: ~95%\n- **Validation Accuracy**: ~92%\n- **Model Size**: ~14 MB (optimized for deployment)\n- **Inference Time**: \u003c100ms per image\n\n## 🚀 Installation \u0026 Setup\n\n### Prerequisites\n\n- Python 3.8 or higher\n- pip (Python package manager)\n- Git\n\n### Local Setup\n\n1. **Clone the repository**\n\n```bash\ngit clone https://github.com/arpanpramanik2003/smart-waste-classification.git\ncd smart-waste-classification\n```\n\n2. **Create a virtual environment** (recommended)\n\n```bash\npython -m venv venv\n\n# On Windows\nvenv\\Scripts\\activate\n\n# On macOS/Linux\nsource venv/bin/activate\n```\n\n3. **Install dependencies**\n\n```bash\npip install -r requirements.txt\n```\n\n4. **Extract the dataset** (if needed for training)\n\n```bash\nunzip dataset.zip\n```\n\n5. **Run the application**\n\n```bash\nstreamlit run app.py\n```\n\n6. **Access the application**\n\nOpen your browser and navigate to: `http://localhost:8501`\n\n## 🐳 Docker Deployment\n\n### Build Docker Image\n\n```bash\ndocker build -t smart-waste-classifier .\n```\n\n### Run Docker Container\n\n```bash\ndocker run -p 8501:8501 smart-waste-classifier\n```\n\n### Docker Compose (Optional)\n\n```bash\ndocker-compose up\n```\n\n## ☁️ Cloud Deployment\n\n### Heroku Deployment\n\n1. **Install Heroku CLI**\n\n```bash\nheroku login\n```\n\n2. **Create Heroku app**\n\n```bash\nheroku create your-app-name\n```\n\n3. **Deploy**\n\n```bash\ngit push heroku master\n```\n\n### Fly.io Deployment\n\n1. **Install Fly CLI**\n\n```bash\nfly auth login\n```\n\n2. **Launch app**\n\n```bash\nfly launch\n```\n\n3. **Deploy**\n\n```bash\nfly deploy\n```\n\n## 💻 Usage Guide\n\n### Web Application\n\n1. **Launch the application** using one of the methods above\n2. **Upload an image** of waste material\n   - Supported formats: JPG, JPEG, PNG\n   - Recommended: Clear, well-lit images\n3. **View prediction results**\n   - Waste category classification\n   - Confidence score\n   - Recycling recommendations\n4. **Follow recycling suggestions** for proper waste disposal\n\n### Jupyter Notebook (Training/Experimentation)\n\n```bash\njupyter notebook TrashNet.ipynb\n```\n\nUse the notebook to:\n- Explore the dataset\n- Train new models\n- Experiment with different architectures\n- Evaluate model performance\n- Visualize training metrics\n\n### Image Visualization Utility\n\n```python\nfrom imshow import display_image\n\n# Display image with predictions\ndisplay_image('path/to/image.jpg', model, class_names)\n```\n\n## 🔧 Configuration \u0026 Customization\n\n### Model Customization\n\nEdit `TrashNet.ipynb` to modify:\n- Model architecture\n- Hyperparameters\n- Training strategy\n- Data augmentation techniques\n\n### Application Customization\n\nEdit `app.py` to customize:\n- UI theme and layout\n- Image size limits\n- Prediction confidence thresholds\n- Recycling suggestion text\n\n### Deployment Configuration\n\n- **Dockerfile**: Modify base image, dependencies, or runtime settings\n- **Procfile**: Update Heroku dyno commands\n- **fly.toml**: Configure Fly.io deployment settings\n\n## 📦 Dependencies\n\n### Core Dependencies\n\n- **TensorFlow 2.x**: Deep learning framework\n- **Keras**: High-level neural networks API\n- **Streamlit**: Web application framework\n- **NumPy**: Numerical computing\n- **Pillow**: Image processing\n- **Matplotlib**: Data visualization\n\n### Full Dependencies\n\nSee `requirements.txt` for complete list with version specifications.\n\n## 🤝 Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. **Fork the repository**\n2. **Create a feature branch**\n   ```bash\n   git checkout -b feature/YourFeature\n   ```\n3. **Commit your changes**\n   ```bash\n   git commit -m \"Add YourFeature\"\n   ```\n4. **Push to the branch**\n   ```bash\n   git push origin feature/YourFeature\n   ```\n5. **Open a Pull Request**\n\n### Contribution Guidelines\n\n- Follow PEP 8 style guidelines\n- Add unit tests for new features\n- Update documentation as needed\n- Ensure all tests pass before submitting PR\n\n## 🐛 Known Issues \u0026 Limitations\n\n- Model performance may vary with images taken in poor lighting conditions\n- Very small or obscured waste items may be misclassified\n- Mixed waste (multiple categories in one image) will classify as the dominant category\n- Model size optimized for deployment may have slightly lower accuracy than full model\n\n## 🔮 Future Enhancements\n\n- [ ] Multi-label classification for images containing multiple waste types\n- [ ] Real-time video stream classification\n- [ ] Mobile application (iOS/Android)\n- [ ] Integration with waste management APIs\n- [ ] Expanded dataset with more waste categories\n- [ ] Localization support for multiple languages\n- [ ] User feedback mechanism to improve model\n- [ ] Analytics dashboard for waste statistics\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n```\nMIT License\n\nCopyright (c) 2024 Arpan Pramanik\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n```\n\n## 👨‍💻 Author\n\n**Arpan Pramanik**\n\n- GitHub: [@arpanpramanik2003](https://github.com/arpanpramanik2003)\n- Repository: [smart-waste-classification](https://github.com/arpanpramanik2003/smart-waste-classification)\n\n## 🙏 Acknowledgments\n\n- **TrashNet Dataset**: Thanks to Gary Thung and Mindy Yang for creating and sharing the TrashNet dataset\n- **MobileNet**: Google Research for the efficient MobileNet architecture\n- **Streamlit**: For providing an excellent framework for building ML web applications\n- **TensorFlow/Keras**: For powerful deep learning tools and APIs\n- **Open Source Community**: For inspiration and various tools that made this project possible\n\n## 📞 Support \u0026 Contact\n\nFor questions, issues, or suggestions:\n\n- **Open an issue**: [GitHub Issues](https://github.com/arpanpramanik2003/smart-waste-classification/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/arpanpramanik2003/smart-waste-classification/discussions)\n\n## 🌟 Star This Repository\n\nIf you find this project useful, please consider giving it a ⭐️ on GitHub!\n\n---\n\n**Made with ❤️ for a sustainable future**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpanpramanik2003%2Fsmart-waste-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farpanpramanik2003%2Fsmart-waste-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpanpramanik2003%2Fsmart-waste-classification/lists"}