This project implements a smart attendance system using face recognition technology, allowing efficient and automated attendance tracking for educational institutions. The system utilizes various libraries for face detection and recognition.
- Real-time face recognition: Automatically identifies students from the video stream.
- Attendance logging: Maintains records of student attendance.
- User-friendly interface: Easy for instructors and administrators to use.
- Python: Core programming language
- OpenCV: Computer vision library for face detection and image processing
- Haar Cascade Classifier: Pre-trained model for face detection (haarcascade_frontalface_default.xml)
- SQLite: Database for storing attendance records and face data
- NumPy: Numerical computing library
- Python 3.6 or higher
- pip (Python package manager)
- Webcam or camera device
-
Clone the repository:
git clone https://github.com/Adit-Jana/smart-attendance-system-using-face-recognition.git cd smart-attendance-system-using-face-recognition -
Install required dependencies:
pip install opencv-python opencv-contrib-python numpy
Create a dataset of face images for the system:
python dataset1.pyThis will capture multiple images of a person's face for training purposes.
Train the face recognition model using the captured dataset:
python train2.pyThis generates a trained recognizer model in the recognizer/ directory.
Execute the main application:
python final4.pyThe system will:
- Detect faces in real-time using the webcam
- Recognize known faces and match them against the training data
- Log attendance records to
attn.txt
Check the attendance log:
cat attn.txt| File | Purpose |
|---|---|
dataset1.py |
Captures face images and stores them for training |
train2.py |
Trains the face recognition model using captured images |
detector3.py |
Handles face detection using Haar Cascade classifier |
drycheck.py |
Validates the system and checks configurations |
final4.py |
Main application - runs the attendance system |
FaceBase.db |
SQLite database storing face encodings and user data |
attn.txt |
Text file logging attendance records with timestamps |
haarcascade_frontalface_default.xml |
Pre-trained classifier for face detection |
- Face Detection: The system uses Haar Cascade Classifier to detect faces in the video stream
- Face Training: Captured face images are processed and a recognizer model is trained
- Face Recognition: During runtime, detected faces are compared against the trained model
- Attendance Logging: Recognized faces are logged with timestamps in the attendance file
- Modify
dataset1.pyto adjust the number of training images captured per person - Adjust confidence thresholds in
final4.pyto control recognition accuracy - Update database path in scripts if needed
| Issue | Solution |
|---|---|
| Camera not detected | Check camera permissions and ensure the device is connected |
| Poor recognition accuracy | Capture more images in dataset1.py and retrain the model |
| Database errors | Ensure FaceBase.db has proper read/write permissions |
| Face not detected | Ensure adequate lighting and adjust Haar Cascade parameters |
- Add support for multiple face recognition algorithms (LBPH, Deep Learning)
- Implement web interface for easy attendance viewing
- Add email notifications for administrators
- Support for integration with existing attendance systems
- Real-time dashboard for attendance statistics
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add YourFeature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV documentation and community
- Haar Cascade Classifier developers
- Contributors and users of this project
For further inquiries or support, please contact:
- Author: Adit Jana
- GitHub: Adit-Jana
- Repository: smart-attendance-system-using-face-recognition