Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ AI Attendance System

An AI-powered Attendance Management System that leverages Face Recognition, Voice Verification, and QR Code Authentication to provide a secure and intelligent attendance tracking solution.

Built using Python, Streamlit, Supabase, Dlib, Resemblyzer, and PyTorch, this project demonstrates how multiple biometric authentication methods can be combined into a single attendance platform.


πŸš€ Features

πŸ‘€ Face Recognition Attendance

  • Register users with facial data.
  • Detect and recognize faces in real time.
  • Prevent duplicate attendance entries.
  • Store attendance records securely.

🎀 Voice Verification

  • Speaker authentication using Resemblyzer.
  • Voice embedding generation and comparison.
  • Additional security layer beyond face recognition.

πŸ“± QR Code-Based Attendance

  • Students scan the QR code to access the attendance portal instantly.
  • Eliminates the need for manually sharing class links.

πŸ” User Authentication

  • Secure login system.
  • Password hashing using bcrypt.
  • Role-based access support (Teacher/Student).

πŸ“Š Dashboard & Analytics

  • Attendance history tracking.
  • User-friendly Streamlit interface.

☁️ Cloud Database Integration

  • Supabase backend for:
    • User management
    • Attendance records
    • Authentication data
    • Biometric metadata storage

πŸ—οΈ System Architecture

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚    Streamlit UI   β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚                β”‚                β”‚
         β–Ό                β–Ό                β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚ Face Moduleβ”‚   β”‚ Voice Moduleβ”‚   β”‚ QR Module  β”‚
 β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚                 β”‚                β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Supabase DB  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Frontend

  • Streamlit

Backend

  • Python

Database

  • Supabase

Machine Learning & AI

  • Face Recognition
  • Dlib
  • PyTorch
  • Resemblyzer
  • Librosa
  • Scikit-Learn

Security

  • bcrypt

Utilities

  • Pandas
  • NumPy
  • Pillow
  • Segno (QR Code Generator)

πŸ“‚ Project Structure

β”œβ”€β”€ src/ 
    β”œβ”€β”€ Ui/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   └── base_layout.py 
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ assets/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ logo.png
    β”‚   β”œβ”€β”€ student.png
    β”‚   └── teacher.png
    β”œβ”€β”€ screens/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ student_screen.py 
    β”‚   β”œβ”€β”€ teacher_screen.py 
    β”‚   └── home_screen.py 
    β”œβ”€β”€ components/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ footer.py
    β”‚   β”œβ”€β”€ dialog_share_subject.py 
    β”‚   β”œβ”€β”€ dialog_create_subject.py 
    β”‚   β”œβ”€β”€ attendence_result_dialog.py 
    β”‚   β”œβ”€β”€ subject_card.py 
    β”‚   β”œβ”€β”€ enroll_dialog.py 
    β”‚   β”œβ”€β”€ auto_enroll_dialog.py 
    β”‚   β”œβ”€β”€ add_photos_dialog.py 
    β”‚   β”œβ”€β”€ voice_attendence_dialog.py 
    β”‚   β”œβ”€β”€ header.py (1300 tokens)
    β”‚   β”œβ”€β”€ Student_screen_layout.py 
    β”‚   └── teacher_screen_layout.py 
    β”œβ”€β”€ database/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ config.py
    β”‚   └── db.py 
    └── pipelines/ 
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ voice_pipeline.py 
    β”‚   └── face_pipeline.py 
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .streamlit/ 
    └── config.toml
β”œβ”€β”€ requirements.txt
└── app.py 

βš™οΈ Installation

1. Clone Repository

git clone https://github.com/YourUsername/AI-Attendance-System.git](https://github.com/BhupatiNadar/Ai-Attendence-System.git
cd AI-Attendance-System

2. Create Virtual Environment

Windows

python -m venv venv
venv\Scripts\activate

Linux / Mac

python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

πŸ”‘ Environment Configuration

Create:

.streamlit/secrets.toml

Example:

SUPABASE_URL="your_supabase_url"
SUPABASE_KEY="your_supabase_key"

πŸ—„οΈ Supabase Setup

Create required tables:

teachers Table

create table teachers(
  teacher_id bigint generated by default as identity primary key,
  username text unique not null,
  name text not null,
  password text not null
);

students Table

create table students(
  student_id bigint generated by default as identity primary key,
  name text not null,
  face_embedding jsonb,
  voice_embedding jsonb
);

subjects Table

create table subjects(
  subject_id bigint generated by default as identity primary key,
  subject_code text not null,
  name text default 'unknown',
  section text default 'N/A',
  teacher_id bigint references teachers(teacher_id) on delete set null
);

subject_students Table

create table subject_students(
  subject_id bigint references subjects(subject_id) on delete cascade,
  student_id bigint references students(student_id) on delete cascade,
  primary key(subject_id, student_id)
);

attendance_logs Table

create table attendance_logs(
  id bigint generated by default as identity primary key,
  timestamp timestamptz default now(),
  subject_id bigint references subjects(subject_id) on delete cascade,
  student_id bigint references students(student_id) on delete cascade,
  ispresent boolean default true
);

You can extend the schema based on project requirements.


▢️ Running the Application

streamlit run app.py

Default URL:

http://localhost:8501

πŸ“Έ Attendance Methods

Face Recognition

  1. Register face samples.
  2. Capture webcam image.
  3. Generate face encoding.
  4. Match with stored embeddings.
  5. Mark attendance.

Voice Verification

  1. Record user voice.
  2. Extract speaker embeddings.
  3. Compare against stored embeddings.
  4. Verify identity.
  5. Mark attendance.

QR Attendance

  1. Generate unique QR code.
  2. Scan QR using camera.
  3. Validate QR data.
  4. Join class.

πŸ“¦ Dependencies

streamlit 
numpy
pandas 
matplotlib 
seaborn

scikit-learn
dlib-bin
git+https://github.com/ageitgey/face_recognition_models.git
setuptools

supabase
bcrypt

segno # for qr code generation
pillow

librosa

torch --index-url https://download.pytorch.org/whl/cpu
webrtcvad-wheels
# resemblyzer --no-deps
git+https://github.com/resemble-ai/Resemblyzer.git

# ngrok http 8501
pyngrok

πŸ”’ Security Features

  • Password hashing using bcrypt
  • Biometric authentication
  • Secure cloud database storage
  • Attendance duplication prevention

🎯 Future Improvements

  • Mobile application
  • Multi-camera support
  • Liveness detection
  • Anti-spoofing mechanisms
  • Face mask recognition
  • Voice anti-replay detection
  • Email notifications
  • Attendance export to Excel/PDF
  • Admin analytics dashboard
  • Real-time monitoring

🀝 Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a new branch.
git checkout -b feature/new-feature
  1. Commit changes.
git commit -m "Add new feature"
  1. Push branch.
git push origin feature/new-feature
  1. Open a Pull Request.


πŸ‘¨β€πŸ’» Author

Bhupati Nadar

GitHub: https://github.com/BhupatiNadar


⭐ Support

If you found this project useful:

⭐ Star the repository

🍴 Fork the project

πŸ“’ Share it with others


Built with Python, AI, Face Recognition, Voice Biometrics, QR Technology, and Supabase.

Releases

Packages

Contributors

Languages