Project Write-up · AI / Computer Vision

Taking attendance by just looking.

Rahul Bhushan Vemula· ~5 min read· PythonOpenCVLBPHMySQLMongoDB
SQL · NoSQL

Marking attendance by hand is slow, easy to game, and nobody enjoys it. So I built a system that does it by simply looking at who's in the room — real-time face recognition that logs attendance automatically, backed by a deliberately split storage design.

01Why face recognition, and why LBPH

The goal was a system that works on ordinary hardware, in a real classroom, without a GPU or a cloud bill. That constraint shaped the core choice. I used LBPH (Local Binary Patterns Histograms) through OpenCV rather than a heavy deep-learning model.

LBPH is a classic computer-vision technique: it describes a face by the local texture patterns around each pixel rather than trying to learn everything from scratch. That makes it lightweight, fast, and — importantly — reasonably robust to lighting changes, which is exactly the kind of variation a real classroom throws at you. A flashier model would have needed far more compute for a problem that didn't demand it.

The design instinct

Match the tool to the constraint. A deep network might edge out LBPH on a benchmark, but it can't run on the modest hardware this system targets. The best model is the one that actually runs where it needs to.

02The hybrid storage decision

This is the part I find most interesting. I split storage across two databases on purpose, because the two kinds of data have genuinely different shapes:

Using one database for both would have meant compromising on one of them. Splitting by data shape let each store do what it's good at.

03How a single attendance mark happens

1

Capture

OpenCV pulls a frame from the camera and detects any faces in view.

2

Recognise

Each detected face is matched against enrolled profiles using LBPH.

3

Resolve identity

A confident match maps the face to a registered user pulled from MongoDB.

4

Log it

The attendance event is written to MySQL — timestamped and tied to the right session.

04What I took away

Two lessons. First, that not every problem needs deep learning — a well-chosen classic algorithm can be the more engineering-sound answer when constraints are real. Second, that thinking about data by its shape, not by habit, leads to better architecture: structured records and flexible media genuinely belong in different homes. That instinct to question the default is the one I keep sharpening.

Curious about the build?

Happy to walk through the recognition pipeline or the storage split.