Skip to content

CodeSmithsLab/SIH25012

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SIH25012: Automated Attendance System for Rural Schools

Python OpenCV Face Recognition License

๐ŸŽฏ Smart India Hackathon 2025 Submission

Project ID: SIH25012
Project Title: Automated Attendance System for Rural Schools
Team: CodeSmiths
Institution: University of Scinece and Technology, Meghalaya

๐Ÿ“‹ Table of Contents

๐Ÿ” Overview

The Automated Attendance System for Rural Schools is an innovative solution designed to address the challenges of manual attendance tracking in remote educational institutions. Using advanced computer vision and facial recognition technology, this system provides a reliable, efficient, and cost-effective method for automating student attendance.

๐ŸŽฏ Problem Statement

Rural schools face significant challenges with traditional attendance systems:

  • Manual Processes: Time-consuming paper-based attendance tracking
  • Human Error: Proxy attendance and manual recording errors
  • Resource Constraints: Limited technological infrastructure
  • Data Management: Difficulty in maintaining and analyzing attendance records
  • Administrative Burden: Teachers spending valuable time on attendance instead of teaching

๐Ÿ’ก Solution

Our system leverages facial recognition technology to provide:

  • Real-time Face Detection: Instant recognition of students using webcam
  • Automated Record Keeping: Digital attendance logs with timestamps
  • Duplicate Prevention: Smart logic to prevent multiple entries per day
  • Performance Optimization: Multi-processing architecture for smooth operation
  • Scalable Design: Easy to deploy across multiple rural schools

โœจ Features

Core Functionality

  • ๐ŸŽฅ Real-time Webcam Attendance: Live face recognition using standard webcam
  • ๐Ÿ‘ฅ Multi-face Detection: Simultaneous recognition of multiple students
  • ๐Ÿ“Š CSV Export: Daily attendance reports in standard format
  • ๐Ÿšซ Duplicate Prevention: Prevents multiple entries for same student per day
  • ๐Ÿ“ฑ Simple UI: Easy-to-use admin panel interface

Performance Features

  • โšก Multiprocessing: Separate processes for capture and recognition
  • ๐ŸŽฏ Frame Optimization: Intelligent frame skipping and scaling
  • ๐Ÿ“ˆ FPS Monitoring: Real-time performance tracking
  • ๐Ÿ’พ Memory Efficient: Optimized queue management

Administrative Features

  • ๐Ÿ‘จโ€๐ŸŽ“ Student Registration: Easy face encoding and registration
  • ๐Ÿ“‹ Daily Reports: Automatic generation of attendance records
  • ๐Ÿ” Search Capability: Quick student lookup and verification
  • ๐Ÿ“ฑ Batch Processing: Support for processing multiple images

๐Ÿ—๏ธ Technical Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Main Process  โ”‚โ”€โ”€โ”€โ”€โ”‚  Frame Capture   โ”‚โ”€โ”€โ”€โ”€โ”‚   Camera Feed   โ”‚
โ”‚   (UI & Control)โ”‚    โ”‚   (OpenCV)       โ”‚    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                       โ”‚
          โ”‚                       โ–ผ
          โ”‚            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚            โ”‚  Multiprocessing โ”‚
          โ”‚            โ”‚     Queue        โ”‚
          โ”‚            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                       โ”‚
          โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Attendance     โ”‚    โ”‚ Face Recognition  โ”‚
โ”‚  Logging        โ”‚โ—„โ”€โ”€โ”€โ”‚   Worker Process  โ”‚
โ”‚  (CSV Output)   โ”‚    โ”‚ (face_recognition)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

  • Programming Language: Python 3.13.5
  • Computer Vision: OpenCV 4.12.0.88
  • Face Recognition: face_recognition library (dlib-based)
  • Data Processing: NumPy, Pandas
  • File Handling: CSV, Pickle
  • Concurrency: Multiprocessing
  • Logging: Python logging module

๐Ÿš€ Installation

Prerequisites

# Python 3.13 or higher
python --version

# pip package manager
pip --version

Setup Instructions

  1. Clone the Repository
git clone https://github.com/monsurcodes/SIH25012.git
cd SIH25012/prototype
  1. Create Virtual Environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activate
  1. Install Dependencies
pip install opencv-python
pip install face-recognition
pip install numpy
pip install dlib  # Required for face_recognition
  1. Prepare Data Directories
mkdir -p data/known_faces
mkdir -p output
mkdir -p logs
  1. Add Student Photos
  • Place student photos in data/known_faces/ directory
  • Use format: ROLLNO_Name.jpg (e.g., 2025-BCSE-0015_Monsur.jpg)

๐ŸŽฎ Usage

1. Running the Application

python main.py

2. Admin Panel Options

**** Admin Panel ****

1. Run attendance system
2. Register faces
3. Quit

3. Face Registration

  • Select option 2 to encode student faces
  • System will process all images in data/known_faces/
  • Encodings saved to data/encodings.pickle

4. Live Attendance

  • Select option 1 to start webcam attendance
  • Position students in front of camera
  • System automatically detects and logs attendance
  • Press 'q' to quit

File Descriptions

main.py

Purpose: Application entry point and admin interface

  • Provides interactive menu system
  • Orchestrates face registration and attendance processes
  • Handles user input and navigation

recognizer.py

Purpose: Core facial recognition and attendance logic

  • AttendanceRecognizer class: Main recognition engine
  • process_webcam_multiprocess(): Optimized real-time attendance
  • mark_attendance(): Attendance logging with duplicate prevention
  • face_recognition_worker(): Multiprocessing worker function

encoders.py

Purpose: Face encoding and student registration

  • encode_known_faces(): Processes student photos
  • Extracts facial features and creates encodings
  • Supports batch processing of multiple images
  • Handles roll number extraction from filenames

logger.py

Purpose: Centralized logging configuration

  • get_logger(): Creates configured logger instances
  • Dual output: console and file logging
  • Structured log format with timestamps
  • Error tracking and debugging support

โšก Performance Optimization

Multiprocessing Architecture

  • Separate Processes: Camera capture and face recognition run independently
  • Queue Management: Efficient inter-process communication
  • Frame Skipping: Processes every Nth frame to reduce load
  • Dynamic Scaling: Resizes frames for faster processing

Optimization Parameters

# Configurable performance settings
process_every_n_frames = 3    # Process every 3rd frame
scale_factor = 0.5           # 50% size reduction
queue_maxsize = 1            # Minimal queue for real-time processing

Performance Metrics

  • Standard Mode: ~5-8 FPS on average hardware
  • Optimized Mode: ~15-25 FPS with multiprocessing
  • Memory Usage: <200MB typical operation
  • CPU Usage: Distributed across multiple cores

๐Ÿš€ Future Enhancements

Phase 2 Development

  • Web Interface: Browser-based admin panel
  • Database Integration: MySQL/PostgreSQL support
  • Mobile App: Android/iOS companion apps
  • Cloud Deployment: AWS/Azure cloud hosting

Advanced Features

  • Emotion Detection: Student engagement analysis
  • Anti-spoofing: Protection against photo attacks
  • Batch Import: Excel/CSV student data import
  • Analytics Dashboard: Attendance trends and insights

Rural-Specific Features

  • Offline Mode: Function without internet connectivity
  • Low-bandwidth Sync: Efficient data synchronization
  • Multi-language Support: Local language interfaces
  • SMS Integration: Attendance notifications to parents

๐ŸŽฏ Impact and Benefits

For Rural Schools

  • Time Savings: Reduces attendance time by 80%
  • Accuracy: Eliminates proxy attendance and human errors
  • Cost Effective: Uses standard hardware (webcam + laptop)
  • Easy Deployment: Minimal technical expertise required

For Educators

  • Focus on Teaching: More time for educational activities
  • Digital Records: Automated attendance tracking
  • Performance Insights: Student attendance patterns
  • Administrative Efficiency: Streamlined processes

For Students

  • Contactless System: Hygienic and convenient
  • Quick Process: Instant recognition and logging
  • Fair System: Eliminates favoritism or errors
  • Privacy Friendly: Local processing, no cloud storage

๐Ÿค Contributing

We welcome contributions to improve the system:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ† Acknowledgments

  • Smart India Hackathon 2025 for providing the platform
  • OpenCV Community for computer vision tools
  • dlib Library for facial recognition capabilities
  • Rural Education Initiative for problem identification

๐Ÿ“ž Contact

Team Lead: Monsur Email: monsurcodes@outlook.com
Project Repository: https://github.com/monsurcodes/SIH25012


Made with โค๏ธ for Rural Education in India

This project is part of Smart India Hackathon 2025 - Building solutions for tomorrow's India

About

Automated Attendance System for Rural Schools

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages