Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.
/ face-rekognition Public archive

Academic IoT project demonstrating automated attendance using ESP32-CAM, AWS IoT, Lambda, and face recognition.

License

Notifications You must be signed in to change notification settings

kascit/face-rekognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

This repository is archived.
It is kept as a personal learning and experimentation project and is no longer actively developed.

AWS-Based Smart Attendance System using Face Recognition (IoT + Cloud)

πŸ“¦ This repository contains an academic, proof-of-concept project developed as part of a college course.
It demonstrates an end-to-end IoT β†’ Cloud β†’ AI pipeline for automated attendance marking using face recognition.

The repository is intended as a learning and architectural showcase and is not actively maintained.


⚠️ Important Disclaimer (Read First)

Warning

Educational & Ethical Use Only

  • This project was developed strictly for academic purposes.
  • All face recognition was conducted in a consensual, controlled environment.
  • The system is a prototype and not intended for production deployment.
  • No real credentials, private keys, or secrets are included in this repository.
  • Any sensitive values (Wi-Fi credentials, AWS certificates, endpoints) have been intentionally redacted or replaced with placeholders.

Use responsibly and in compliance with privacy, biometric, and data-protection regulations.


πŸ“– Introduction

Background & Motivation

Manual attendance systems are inefficient, error-prone, and difficult to scaleβ€”especially in environments such as classrooms and laboratories. With the growth of IoT devices, cloud computing, and AI services, it is now possible to automate such workflows in a reliable and scalable manner.

This project explores how a low-cost edge device (ESP32-CAM) can be integrated with AWS cloud services to create a fully automated attendance pipeline powered by face recognition.

The focus of the project is not just face recognition, but the complete system design:

  • Edge data capture
  • Secure device-to-cloud communication
  • Event-driven cloud processing
  • Serverless architecture
  • Persistent attendance storage

🎯 Objectives

  • Build an end-to-end attendance system using IoT and AWS
  • Capture images periodically from an ESP32-CAM
  • Transmit images securely using MQTT over TLS
  • Process images using AWS Lambda
  • Perform face recognition using AWS Rekognition
  • Store attendance records in DynamoDB
  • Demonstrate real-world use of event-driven serverless architecture

🧠 High-Level System Overview

What the system does

  1. ESP32-CAM captures an image every 10 seconds
  2. Image is encoded as Base64
  3. Image is sent securely to AWS IoT Core via MQTT
  4. AWS IoT Rule triggers a Lambda function
  5. Image is decoded and stored in Amazon S3
  6. S3 upload triggers:
    • Face indexing (for enrollment)
    • Face matching (for attendance)
  7. Attendance is marked in DynamoDB based on:
    • Face match confidence
    • Time difference (β‰₯ 30 minutes)
    • Class period (IST)

πŸ—οΈ Architecture Diagram

flowchart LR
    A[ESP32-CAM] -->|MQTT over TLS| B[AWS IoT Core]
    B -->|IoT Rule| C[Lambda: Image Decoder]
    C -->|JPEG Upload| D[S3 Bucket]
    D -->|S3 Event| E[Lambda: Face Indexing]
    D -->|S3 Event| F[Lambda: Face Matching]
    E -->|Index Faces| G[AWS Rekognition Collection]
    F -->|Search Faces| G
    F -->|Attendance Update| H[DynamoDB]
Loading

πŸ”Œ Edge Device: ESP32-CAM

Responsibilities

  • Capture images using onboard camera
  • Encode image data to Base64
  • Publish JSON payloads to AWS IoT Core
  • Maintain secure TLS connection using X.509 certificates

Key Characteristics

  • Image capture interval: 10 seconds
  • Communication protocol: MQTT
  • Transport security: TLS (Port 8883)

πŸ”’ Note: All credentials, certificates, and private keys are intentionally excluded from this repository.


☁️ Cloud Components (AWS)

1️⃣ AWS IoT Core

  • Acts as the secure entry point for IoT messages
  • Authenticates ESP32 using X.509 certificates
  • Routes messages using IoT Rules

2️⃣ Lambda β€” Image Ingestion

Trigger: AWS IoT Rule Function:

  • Decodes Base64 image payload
  • Generates timestamp-based filename
  • Uploads image to Amazon S3

3️⃣ Amazon S3

  • Temporary storage for captured images
  • Acts as an event source for downstream processing

4️⃣ Lambda β€” Face Indexing

Trigger: S3 Object Created Function:

  • Indexes detected faces into a Rekognition Collection
  • Uses ExternalImageId (mapped to student roll number)

5️⃣ Lambda β€” Attendance Processing

Trigger: S3 Object Created Function:

  • Searches face against Rekognition Collection
  • Applies confidence threshold (β‰₯ 95%)
  • Converts timestamp to IST
  • Determines class period
  • Updates attendance in DynamoDB

6️⃣ AWS Rekognition

  • Managed face recognition service
  • Stores facial embeddings in a persistent collection
  • Used as-is, without custom ML logic

7️⃣ DynamoDB

  • Stores attendance records using:

    • RollNumber (Partition Key)
    • Date (Sort Key)
  • Tracks:

    • In-time
    • Out-time
    • Attendance status per period

⏱️ Attendance Logic

  • Attendance periods: 9 AM – 4 PM (IST)

  • Periods are hourly (1–7)

  • A student is marked Present if:

    • Face match confidence β‰₯ 95%
    • Time difference between first and last detection β‰₯ 30 minutes (to reduce misuse and ensure sustained presence)
    • Detection occurs within a valid period

πŸ“‚ Project Structure (Logical)

.
β”œβ”€β”€ esp32/
β”‚   └── esp32_cam_mqtt.ino
β”‚
β”œβ”€β”€ lambdas/
β”‚   β”œβ”€β”€ image_ingest_lambda.py
β”‚   β”œβ”€β”€ face_index_lambda.py
β”‚   └── attendance_lambda.py
β”‚
β”œβ”€β”€ README.md
└── .gitignore

πŸ” Security Considerations

  • No secrets are committed

  • All credentials are replaced with placeholders

  • .gitignore excludes:

    • Certificates
    • Private keys
    • Environment configs
  • Designed following least-privilege IAM principles


βš–οΈ Ethics & Privacy

  • Explicit consent was assumed during data collection
  • System was deployed in a controlled academic environment
  • No public or unauthorized biometric data was processed
  • This repository exists purely for educational demonstration

πŸ§ͺ Project Status

  • βœ… Core pipeline implemented
  • ❌ Frontend / dashboard not implemented
  • ❌ Firebase integration planned but not completed
  • πŸ“¦ Repository archived as a learning artifact

🏁 Conclusion

This project demonstrates how IoT, cloud services, and AI can be combined to build a real-world, event-driven system using modern architectural patterns.

Beyond face recognition, the project highlights:

  • Secure device-to-cloud communication
  • Serverless, scalable processing
  • Practical use of managed AI services
  • Clean separation between edge, compute, and data layers

It serves as a strong academic and architectural showcase for cloud-native system design.


πŸ“œ License

MIT License Provided as-is, for educational and learning purposes.

This repository is archived.
It is kept as a personal learning and experimentation project and is no longer actively developed.

About

Academic IoT project demonstrating automated attendance using ESP32-CAM, AWS IoT, Lambda, and face recognition.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published