A secure, web-based attendance system using Flask and OpenCV that automates check-ins with real-time facial recognition. Includes blink-based liveness detection and GPS geofencing to prevent spoofing and ensure users are physically present at the designated location.
A modern, secure, and automated attendance tracking system built using Flask and OpenCV. This application replaces traditional attendance methods with real-time facial recognition, enhanced by liveness detection and geolocation verification.
- 🎥 Real-time facial recognition via webcam
- 👁️ Blink detection for liveness verification (anti-spoofing)
- 📍 GPS-based geofencing for location validation
- 🌐 Web-based interface using Flask
- 🗂️ Automated attendance logging
- 🔒 Secure and tamper-resistant system
- Backend: Flask (Python)
- Computer Vision: OpenCV, face recognition libraries
- Frontend: HTML, CSS, JavaScript
- Database: SQLite / MySQL (configurable)
- APIs: Geolocation API (browser-based)
- Clone the repository:
git clone https://github.com/your-username/smart-attendance-system.git cd smart-attendance-system
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Run the application:
```bash
python app.py
```
5. Open in browser:
```
http://127.0.0.1:5000/
```
---
## 📸 How It Works
1. User logs in to the system
2. Webcam captures face in real-time
3. Facial recognition verifies identity
4. Blink detection ensures the user is live
5. GPS location is checked against predefined geofence
6. Attendance is marked automatically
---
## 📂 Project Structure
```
├── static/
├── templates/
├── models/
├── app.py
├── requirements.txt
└── README.md
```
---
## 🔐 Security Features
* Prevents photo/video spoofing using blink detection
* Ensures physical presence via geofencing
* Eliminates proxy attendance
---
## 📈 Future Enhancements
* Mobile app integration
* Cloud database support
* Multi-face detection for classrooms
* Admin analytics dashboard
---
## 🤝 Contributing
Contributions are welcome! Feel free to fork this repo and submit a pull request.
---
## 📜 License
This project is licensed under the MIT License.
---
## 💡 Author
Developed by **Vikram Banerjee**
```