Face recognition attendance with Raspberry Pi

RFID cards can be lent to friends. A camera at the classroom door that recognises faces marks attendance without anything to carry, and is a good first project in computer vision.

Raspberry Pi 5Major projectCSE, ECE
Pi 5CAMERAFeatured
Parts
₹11,328
Build
14 weeks
Board
Raspberry Pi 5
Objectives
5

Block diagram

Inputs
  • CAMERA
    Camera Module 3Captures faces at the door
Controller
  • Pi 5
    Raspberry Pi 5Detects and recognises faces
Outputs
  • WEB
    Web registerShows and exports attendance
  • Buzzer and LEDConfirm each person
  • DATA
    Data loggerStores timestamped readings for analysis+

Objectives

  1. To detect faces in live video at 5 frames per second or more.
  2. To recognise enrolled students with over 90% accuracy in classroom light.
  3. To mark attendance once per period and export it as CSV.
  4. To measure accuracy, false matches and speed with 20 enrolled people.
  5. To log timestamped data and analyse it to support the conclusions with evidence.

Parts and specifications

Total about ₹11,328 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Face size

At 1.5 m with a 66° lens and 1280 px width, the frame covers about 1.95 m, so a 16 cm face is about 105 px wide, enough for recognition (aim for over 80 px).

Matching threshold

Each face becomes a 128-number embedding. Accept a match when the Euclidean distance to the stored one is below about 0.5; lower is stricter.

Speed

Detection with HOG at 640 × 480 takes about 100 ms on a Pi 5, embedding about 150 ms per face, so about 4 faces a second.

Pin map

SignalPin or connection
CameraCSI connector (CAM0)
BuzzerGPIO 17
LEDGPIO 27 through 330 Ω
NetworkWi-Fi or Ethernet to show the register

Firmware outline

  1. Enrol: take 10 photos of each student, compute embeddings and store the average with roll number.
  2. Capture frames at 640 × 480; detect faces; skip faces smaller than 80 px.
  3. Compute the embedding and find the nearest enrolled face; accept below the threshold.
  4. Require the same match in 3 frames before marking, to avoid single-frame errors.
  5. Mark once per period; beep; save to SQLite; Flask page shows the register and CSV export.

Test plan

TestExpected result
20 enrolled students, room lightAccuracy over 90%
Unknown personNot matched
Photo of an enrolled student on a phoneNote whether it is fooled (liveness is future work)
Same student walks past twiceMarked once

These rows start your results table when you plan the project.

Viva practice

Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.

1. What is a face embedding?
2. Detection vs recognition?
3. How can it be fooled?
4. What about privacy?
5. Why a Pi and not an ESP32-CAM?

Make it yours

One or two upgrades for a mini project, two to four for a major one.

Build these first

Datasheets and sources to cite

  • Raspberry Pi Camera Module 3 datasheet
  • Schroff, Kalenichenko and Philbin, FaceNet (2015)
  • Digital Personal Data Protection Act 2023

About this project

How much does the face recognition attendance with raspberry pi project cost?

About ₹10,718 for the parts in the base list: Raspberry Pi 5 (4 GB), Raspberry Pi Camera Module 3, Raspberry Pi 5 27 W USB-C supply, 32 GB microSD card, Active buzzer 5 V, LED 5 mm green with 220 Ω, Case with cooler and camera cable.

How long does it take?

About 12 weeks for the base project, built on a Raspberry Pi 5. Each upgrade adds time.

Which branches is it suitable for?

Computer Science / IT (IoT, AI), Electronics and Communication, as a major project.

Which pins and design calculations does it use?

Camera on CSI connector (CAM0); Buzzer on GPIO 17; LED on GPIO 27 through 330 Ω. Worked calculations on this page: face size, matching threshold, speed.

How do I test it?

20 enrolled students, room light: Accuracy over 90%. Unknown person: Not matched. Photo of an enrolled student on a phone: Note whether it is fooled (liveness is future work). Same student walks past twice: Marked once.

What are the objectives?

To detect faces in live video at 5 frames per second or more. To recognise enrolled students with over 90% accuracy in classroom light. To mark attendance once per period and export it as CSV. To measure accuracy, false matches and speed with 20 enrolled people.