♻️ Smart Bin AI
A computer vision-based smart waste segregation system that uses Facial Recognition for user authentication and AI Object Detection to classify waste as Paper or Plastic, awarding points for correct disposal.
🚀 Features
Facial Authentication: Secure login using face_recognition (dlib).
AI Waste Detection: Real-time object detection using MobileNetV2 (TensorFlow/Keras).
Smart Classification: Distinguishes between Plastic (bottles, wrappers) and Paper.
Interactive UI: Web-based dashboard with a 4-step workflow (Register -> Login -> Scan -> Throw).
Admin Analytics: Dashboard to view user leaderboards and recent activity logs.
Gamification: Awards points to users for eco-friendly actions.
🛠️ Tech Stack
Backend: Python (Flask)
Computer Vision: OpenCV, Dlib, Face Recognition
AI Model: TensorFlow / Keras (MobileNetV2)
Database: MySQL
Frontend: HTML5, JavaScript, CSS
📋 Prerequisites
Python 3.8+
MySQL Server
Windows Users: Visual Studio Build Tools (for C++ compiler) or a pre-compiled dlib wheel.
⚙️ Installation
Clone the Repository
git clone https://github.com/yourusername/smart-bin-ai.git cd smart-bin-ai
Create a Virtual Environment
python -m venv .venv
Install Dependencies Note: Installing dlib on Windows can be tricky. If pip install dlib fails, download a pre-compiled .whl file.
pip install flask opencv-python face_recognition tensorflow mysql-connector-python numpy
Setup Database
Update the db_config password in app.py and setup_database.py.
Run the setup script:
python setup_database.py
Start the backend server:
python app.py
Open your browser and visit: http://localhost:5000 (or open index.html directly).
🎮 User Guide
Register: Enter your name and click "Register Face" to enroll.
Authenticate: Click "Authenticate" to log in using facial recognition.
Identify Trash: Click "Identify Trash" and hold the object in the yellow box for 5 seconds.
Throw Trash: Once identified, the "Throw Trash" button unlocks. Hold the object in the center until "LOCKED" appears, then drop it into the bin!
📊 Admin Dashboard
Access the analytics at admin.html (or click the "Admin Dashboard" button) to see:
Top Recyclers (Leaderboard)
Live logs of thrown items and points awarded.
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request.
📄 License
This project is open-source.