MarkIt is an automated attendance system that leverages facial recognition to streamline attendance tracking in schools and colleges. Built using Flask, OpenCV, face_recognition, MongoDB, and web technologies, MarkIt provides real-time attendance logging and a user-friendly dashboard for managing students and subjects.
- Project Overview
- Features
- Technologies Used
- Usage
- Project Structure
- How It Works
- Training the Model
- Future Improvements
MarkIt simplifies attendance management by automatically marking students present using a webcam and facial recognition. Teachers or admins can:
- Register students with photos, IDs, and subjects
- Add, update, or delete subjects and semesters
- Capture live video to recognize students
- Store attendance in MongoDB
- View detailed attendance logs through a web interface
- User Authentication: Secure login and registration for admins/teachers
- Student Management: Add students, upload photos, assign subjects
- Subject Management: Add and delete subjects per semester
- Face Recognition: Real-time detection and identification using webcam
- Automatic Attendance: Marks students present in MongoDB automatically
- Attendance Logs: View attendance by date, subject, or student
- Frontend Interface: Clean web templates with HTML/CSS
-
HTML (HyperText Markup Language):
HTML is used to structure the web pages of MarkIt. It defines the layout of forms, dashboards, login pages, and other interface elements for interacting with the system. -
CSS (Cascading Style Sheets):
CSS is used for styling the HTML pages. It enhances the user interface with colors, fonts, layouts, and responsiveness, making the dashboard and forms visually appealing. -
Flask:
Flask is a lightweight Python web framework that handles the backend of MarkIt. It manages routes, templates, session management, and database interactions to serve dynamic content to users. -
MongoDB:
MongoDB is a NoSQL database used to store all application data. It stores user accounts, student details, subjects, and attendance records in flexible, JSON-like documents, allowing easy updates and queries. -
OpenCV (Open Source Computer Vision Library):
OpenCV is used to capture and process live video feeds from a webcam. It is also used to manipulate images for resizing, drawing text, and displaying the results of face recognition in real-time. -
Socket.IO (Flask-SocketIO):
Socket.IO enables real-time, bidirectional communication between the server and client. In MarkIt, it is used to instantly send recognized student names from the server to the web interface without needing to refresh the page. -
face_recognition Library:
Theface_recognitionPython library is used for detecting and identifying faces in images and video frames. It generates facial encodings and matches them with reference images to automatically mark attendance.
MarkIt is designed to automate and streamline the attendance management process in schools, colleges, and training institutes. Its main usage includes:
- Automatic Attendance Tracking: Uses face recognition to identify students in real-time through a webcam, reducing manual errors and effort.
- Time-Saving: Eliminates the need for traditional roll calls or paper-based attendance, saving teachers significant time.
- Secure Records: Attendance data is stored securely in MongoDB, ensuring reliable record-keeping and easy retrieval.
- Real-Time Updates: Teachers and administrators can see who is present or absent instantly, thanks to the integration with Socket.IO.
- Subject-Wise Tracking: Attendance can be recorded and viewed for individual subjects, semesters, or classes.
- Manual Override: Admins can manually mark students as present or absent in cases where face recognition may fail.
- Analytics & Reporting: Provides a clear view of attendance history for each student, enabling better monitoring of student participation.
- Flexible Deployment: Can be used on desktop systems with a webcam or integrated into existing school intranet systems.
AI-ML-Markit/ ├── pycache/ │ └── (Python compilation cache) │ ├── static/ │ ├── assets/ │ ├── stud img/ # Student image assets │ ├── style.css │ └── styles.css.map │ ├── templates/ │ ├── Addstudent.html │ ├── Attendancelog....html # Attendance log page │ ├── base.html # Main layout template │ ├── dashboard.html │ ├── home.html │ ├── login.html │ ├── register.html │ ├── video_feed.html # Likely for displaying a camera/model output │ └── view_attendan....html # View attendance records page │ ├── uploads1/ # Folder for user/system uploads │ ├── app.py # Main application entry point (server/routing logic) ├── attendance_log.json # JSON file storing attendance data ├── config.py # Configuration variables and settings ├── main.py # Core application logic ├── README.md # Project documentation ├── students1.json # JSON file storing student data/records ├── tempCodeRunn.... # Temporary or utility script └── train.py # Script for training the Machine Learning model
MarkIt leverages computer vision and web technologies to automate attendance. The workflow is as follows:
-
User Registration & Login:
- Administrators and teachers register with their email and password.
- Sessions are maintained securely using Flask sessions.
-
Adding Students and Subjects:
- Admins can add student details along with their photographs.
- Subjects are added semester-wise, and students are assigned to specific subjects.
-
Face Recognition Setup:
- Uploaded student images are processed using the face_recognition library.
- Face encodings are generated and stored for each student.
- Optional image augmentation (rotation, flipping, noise) is applied to improve recognition accuracy.
-
Real-Time Attendance Capture:
- A webcam feed is used to capture students’ faces.
- Each frame is resized and processed to detect faces.
- Detected faces are compared against the stored reference encodings.
- When a match is found, the student is automatically marked as present for the respective subject and date.
-
Attendance Logging:
- Attendance records are stored in MongoDB, including student name, subject, date, and status.
- Socket.IO enables real-time updates so teachers can see attendance immediately.
-
Manual Attendance Management:
- Teachers can manually mark students as present or absent if needed.
- Attendance logs can be filtered by date or subject for detailed reporting.
-
Dashboard & Reporting:
- Provides a visual overview of students, subjects, and attendance.
- Shows total attendance per student and subject for better monitoring.
-
Training & Model Maintenance:
- The system can be retrained using the
train.pyscript whenever new students are added. - Face encodings are saved and reused for faster recognition without retraining each time.
- The system can be retrained using the
This system effectively combines Flask, OpenCV, Socket.IO, MongoDB, and face recognition to provide a secure, fast, and automated attendance solution.
MarkIt uses the face_recognition library to identify students from their images. The training process involves the following steps:
-
Collect Student Images:
- Each student’s photograph is uploaded through the web interface.
- Images are stored in the
uploads1folder on the server.
-
Image Preprocessing & Augmentation:
- Images are optionally augmented using the imgaug library to improve model robustness:
- Horizontal flips
- Rotation (-30° to 30°)
- Gaussian noise
- Preprocessing ensures consistent face detection for different lighting and angles.
- Images are optionally augmented using the imgaug library to improve model robustness:
-
Generate Face Encodings:
- Each student image is processed using
face_recognitionto extract a unique face encoding. - These encodings are numeric representations of facial features that the system uses to identify students.
- Each student image is processed using
-
Save Encodings:
- Encodings are stored in MongoDB or in a local file (
face_encodings.npy) for fast retrieval. - This allows the system to recognize students in real-time without retraining for every session.
- Encodings are stored in MongoDB or in a local file (
-
Testing & Validation:
- Optionally, the model can be tested using new images to ensure recognition accuracy.
- The system compares detected faces against the stored encodings and calculates recognition success.
-
Integration with Real-Time Attendance:
- Once trained, the face encodings are loaded during runtime.
- When a student appears in front of the webcam, the system compares the live frame against the stored encodings to mark attendance automatically.
Note: Whenever new students are added, the system should be retrained using the train.py script to update the face encodings.
While MarkIt provides a fully functional automatic attendance system, there are several areas for potential enhancement:
-
Multi-Face Detection & Recognition:
- Enable the system to detect and recognize multiple students simultaneously in real-time, allowing faster attendance marking in large classrooms.
-
Mobile Integration:
- Develop a mobile-friendly interface or a dedicated mobile app so teachers can access attendance data and manage students from their smartphones.
-
Improved Accuracy with Deep Learning:
- Integrate deep learning-based face recognition models (e.g., FaceNet, ArcFace) to improve recognition accuracy in challenging lighting or partial face scenarios.
-
Integration with Timetables:
- Automatically link attendance to specific class schedules, subjects, and semesters to reduce manual selection of subjects.
-
Notifications & Reporting:
- Send automated notifications to students and parents about attendance status.
- Generate detailed analytics and reports, such as attendance trends, absences, and late entries.
-
Enhanced Security & Authentication:
- Implement two-factor authentication for user login.
- Encrypt sensitive data stored in MongoDB to enhance privacy and security.
-
Offline Mode:
- Allow offline attendance marking when internet connectivity is unavailable and sync the data once the connection is restored.
-
Integration with Biometric Systems:
- Combine face recognition with other biometric systems (like fingerprint or voice recognition) for added verification in critical environments.
These improvements can enhance usability, accuracy, and overall efficiency of the MarkIt attendance system.