3D Liveness and Human-Gated OSINT: Building a Privacy-First Smart Doorbell

June 18, 2026 (5mo ago)

Why I built this

I wanted a smart doorbell that could tell "person I know" from "person I don't" and, for the second case, pull up public context before I decide whether to answer. That second part is the interesting one, and it's what made me stop and think before writing a line of code.

Face recognition on a webcam is a solved problem — the libraries exist, the tutorials are everywhere. What's not solved by any library is the judgment call underneath it: if a stranger walks up to your door, what should software be allowed to do about that, automatically, without you in the loop? My answer, after building this, is: not much. That constraint shaped the project more than the computer vision did.

The project is Secure-OSINT-FaceID: Python and FastAPI on the backend, MediaPipe for detection, DeepFace with ArcFace embeddings for recognition.

The pipeline, at a glance

At a high level, three stages:

  1. Detect — MediaPipe pulls faces out of the webcam stream in real time.
  2. Verify liveness — before anything is matched against known faces, the system checks that it's looking at an actual 3D human head and not a photo held up to the camera.
  3. Match or queue — known faces resolve locally against stored embeddings. Unknown faces get queued for me to review, not auto-processed.

Frames come in at 5 FPS — more on why below, but the short version is that a doorbell doesn't need 30 FPS, it needs enough frames to catch a face reliably with headroom to run detection, liveness, and matching without cooking a laptop.

Local-first isn't a slogan here, it's the architecture

The obvious "fast path" here would have been to throw frames at a cloud face-recognition API and get a match back in a JSON response. I didn't, and it wasn't a close call.

A face embedding is biometric data. Once it leaves your machine and sits on someone else's server, you've lost control of it — you can't un-send it, you're trusting a third party's retention policy, and you've created a target that ties a face to a location, your front door. None of that is necessary to solve "who's at the door." MediaPipe and DeepFace both run comfortably on commodity hardware, so the entire detect-verify-match loop happens on the device. No frame, no embedding, no identity data ever leaves the machine.

This is the kind of decision that's easy to skip when you're a student trying to ship something that works. Cloud APIs are faster to integrate and the demo looks the same either way. But "looks the same in the demo" is the trap — the difference only shows up in what happens to the data afterward, which is the part that actually matters for something watching your front door.

How the 3D liveness check works, conceptually

The classic way to fool a 2D face matcher is embarrassingly simple: hold up a photo, or play a video on a phone screen. If the system only checks "does this pattern of pixels resemble a stored face," a photo passes, because a photo of a face is exactly that.

3D liveness detection adds a second question on top of "does this look like the right face": is this a physical, three-dimensional head in front of the camera right now? Conceptually it relies on cues a flat image can't reproduce — depth and parallax from natural micro-movement, subtle shading across a curved surface versus a flat print, and facial landmarks moving relative to each other in ways consistent with real 3D structure rather than a printed or screen-displayed projection.

A screen replay defeats naive matchers because the matcher never asks the depth question. Once liveness must pass before the identity match runs, a static photo or a paused video frame doesn't get past stage one — the system isn't evaluating photo quality, it's evaluating physical presence.

The part I think matters most: gating OSINT behind a human

This is where the project stops being a face-recognition demo and starts having opinions about automation.

When the doorbell sees an unrecognized face, the tempting next step — the one a lot of "smart security" products would take — is to automatically run a reverse-image lookup and surface whatever public information exists about that person. I built that capability, and a hard wall in front of it: the OSINT lookup does not run unless I explicitly approve it, per visitor, after seeing the queued entry.

Unknown visitors land in a review queue. I look at the entry, and only if I choose to trigger it does the lookup happen. Nothing fires automatically just because a face didn't match.

This isn't a privacy talking point bolted on afterward. It's a deliberate checkpoint because the failure mode of not having one is genuinely bad: a system that silently profiles every stranger at a door is a surveillance tool, full stop, regardless of a student's stated intentions. A human decision at that junction is the difference between a tool that helps me decide and one that decides for me. I'd rather ship the less impressive version of this feature than one that runs OSINT lookups on delivery drivers by default.

Audit trail: knowing what the system did, after the fact

Every access event — recognized, unrecognized, liveness pass or fail, whether an OSINT lookup was triggered — gets written to a timestamped audit dashboard. It's the boring-sounding piece, and I think it's load-bearing for the whole design.

A control checkpoint like the OSINT gate is only meaningful if you can later verify it held. Without a log, "the lookup only runs on approval" is a claim about the code. With a log, it's a claim you can check against a record of what actually happened. It also makes the system legible to me — I can spot a liveness check that's misfiring, or notice if unknown faces are queuing more than expected.

FPS and hardware trade-offs

5 FPS was not an arbitrary choice — it's roughly the point where the pipeline (detection, liveness, embedding comparison, run back-to-back on every frame) stays responsive on hardware I actually own, not a rented GPU box. A doorbell isn't tracking fast motion; it needs to catch a face that's roughly stationary for a second or two. Pushing FPS higher would mean weaker per-frame processing or hardware I wasn't trying to require. Running everything locally already spends the compute budget on privacy over raw throughput, so the frame rate gives a little in return.

What I'd tell other students building similar things

If you're building anything that touches someone's face, default to local processing and treat every "auto-run this on a stranger" feature as needing a deliberate off-switch. The interesting engineering problem here wasn't getting DeepFace to return a match — it was deciding what the system is not allowed to do without me.

Code

The full project, including the FastAPI backend, the liveness pipeline, and the review-queue logic, is on GitHub:

github.com/vaaiiibbhav/Secure-OSINT-FaceID

If you spot something that could be tightened up, or want to talk through the liveness approach, open an issue or a PR.