A camera that tells you someone is at your door is easy to find. Doorwatch tells you when what they're doing looks wrong, and stays quiet when it doesn't.

For judges in 30 seconds

  • Hybrid AI, by design: each frame goes through Firebase AI Logic with InferenceMode.PREFER_ON_DEVICE (Gemini Nano in Chrome, else cloud Gemini): every 2 s on the device, every 5 s in the cloud to fit the quota. Jobs that compare frames across a visit use ONLY_IN_CLOUD on purpose. Code makes the call, and the siren needs no network.
  • What it is: door camera software in Chrome that reads what a visitor does (lingering, trying the handle, going round the side, taking a package), never how they look. It alarms only when two different warning signs add up, so a mask or a hoodie isn't a sign and someone walking up isn't one either.
  • It learns from the family: every "it was fine" or "it was real" is remembered as 9 behaviour numbers (no images) and shapes the next look-alike visit, inside fixed limits. No model is trained.
  • Measured on 13 labelled clips, both paths: 0 of 5 false alarms with frames in the cloud and 0 of 5 with frames on Gemini Nano (about 3 s a frame on my PC). 2 of 8 suspicious visits flagged by rules alone, 4 of 8 with memory. The demo porch theft clip flagged 3 of 3 live plays with frames on-device.
  • A whole product: landing page, live app, an alert flow that ends with a person's decision, and a tested backend.
  • Honest note: Nano is noisier per frame than the cloud model (2 innocent visits reached "watching" on the device, none in the cloud). The two-signs rule kept every one below an alarm.

Inspiration

  • Toronto Police open data shows 112 home invasions from January to September 2026, against 76 in the same months of 2025 (TPS Major Crime Indicators, my query).
  • 94 to 98% of burglar alarm calls are false (US DOJ POP Center guide, 2011), and Toronto Police only dispatch to alarms verified by audio, video or more than one zone (TPS alarm FAQ).

In February 2023, a Toronto father watched on his doorbell app as intruders walked into his house while his 13-year-old was home alone (CTV News). His camera saw someone at the door. It couldn't tell him what they were doing.

People stop trusting alerts they keep getting wrong. I wanted fewer, better alerts, each with the frames that justify it. And most of the debate in Ontario is about what a family can do once someone is already inside. I wanted to help earlier: catch the casing first, so there's time to lock up and call for help.

What it does

  1. Finds the person on the device. MediaPipe and a tracker box each visitor, and the model sees that close-up.
  2. Asks behaviour questions only. Per frame, as JSON: is someone there, where (door, side, away), what they're doing with a package, hand on the handle, looking in a window.
  3. Code decides. One sign means "watching closely". Two different signs within 5 minutes, each seen in 2 frames in a row, is an alarm. A bell press, a drop-off or a "coming home late" tap raises the bar to 3.
  4. Tells a delivery from a theft. The cloud is asked 3 times whether a package was there BEFORE and AFTER the visit, the majority wins per question, and code decides which it was. One answer can flip, so the theft call never rests on one reply. "Unsure" never counts as innocent.
  5. Alarm first, then the family. A local siren that works offline, then an alert with the reasons, frames, It's fine and Call 911, a cloud second opinion, and an incident report with a SHA-256 fingerprint of each frame.
  6. Learns from the answers. A watched visit that matches one the family called real becomes an alarm. A score-only alarm that matches 3 marked fine becomes a chime. A tried handle or a taken package is never softened. Normal visits are never stored.

How I built it

Firebase product Code What it does
AI Logic, prefer on device firebase.ts, analyze.ts Frame model: JSON Schema responseConstraint on the device, gemini-3.5-flash-lite with the Schema builder in the cloud. Each frame is tagged on-device or cloud, with latency.
AI Logic, only in cloud verdict.ts, review.ts Porch check and second opinion. Comparing frames across a visit is a cloud job on purpose.
App Check, reCAPTCHA Enterprise firebase.ts Guards the AI calls.
Anonymous Auth + Firestore memoryStore.ts, firestore.rules Memory at homes/{uid}/cases, own uid only, with an offline cache.
Remote Config memoryStore.ts, adapt.ts Memory settings, clamped to hard limits in code.
Hosting firebase.json Landing page and app.

The page shows Chrome's availability answer, Download on-device model calls initializeDeviceModel, and a 429 backs off. The rules live in rules.ts, with every number in rulesConfig.ts. Also MediaPipe, three.js for the 3D memory view, and a Spring Boot + Postgres backend; 209 web and 44 backend tests run in CI. Built solo, Nov 28 to 30, 2026. The 3D view adapts a renderer from my earlier project StreetProof.

Challenges I ran into

  • A still frame can't show direction. A box in hand could be arriving or leaving, so the model answers presence questions on labelled frames and code works out the direction.
  • 15 requests a minute. Cloud frames are 5 s apart, so a quick grab can fall between them. A 6-second attempted burglary got through.
  • Camera cuts. Frames from two cameras can't be compared, so scene.ts spots a cut and resets the tracker and porch check.
  • Getting Nano to run at all. Chrome sat on version 140 because its updater service was disabled, so the model never installed. Fixing that (Chrome 158) got Nano running, with a 19 s cold start the page now hides by warming the model on load.
  • Two schema formats. The device takes JSON Schema, the cloud the Schema builder. One strict parser reads both, and an unreadable answer skips the frame.

Accomplishments that I'm proud of

Rules alone. 13 labelled clips through the real pipeline, fresh state per clip (raw output, every clip).

Clips Result
2 real single-camera package thefts both flagged
Real theft edited across 2 cameras, real mailbox theft watching (1 sign)
Real attempted burglary, 6 s missed
3 staged: lock picking, window peeking, hand through a window watching (1 sign)
5 staged innocent: couriers, a doorbell, knocks, a parcel normal: 0 false alarms

On the device. The same 13 clips with Gemini Nano scoring the frames (output).

Cloud frames On-device frames
Suspicious flagged 2 of 8 2 of 8
Suspicious noticed 7 of 8 6 of 8
False alarms 0 of 5 0 of 5

With case memory. Leave-one-out: each clip judged with only the other clips in memory (test, output).

Rules alone With memory
Suspicious visits flagged 2 of 8 4 of 8
Innocent visits flagged 0 of 5 0 of 5

Caveats: a small sample, and the staged clips are stock footage. Both memory gains are two look-alike staged window clips, and the memory run replays recorded behaviour numbers rather than running live.

What I learned

  • Hybrid isn't just a fallback. Where a prompt runs changes frame rate, privacy and quota, and some jobs belong in the cloud on purpose.
  • The model reports facts and code makes the call, so every alarm can be explained in plain words.

What's next

  • Tune the rules separately for on-device frames, since Nano reports a hand on the handle more often.
  • Send flagged frames to S3 (the signed-link API exists), use a phone as the camera so an offline house can still text, and add more real incident clips.

Built With

  • chrome-prompt-api
  • cloud-firestore
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • firebase-remote-config
  • gemini
  • gemini-nano
  • java
  • mediapipe
  • postgresql
  • recaptcha-enterprise
  • s3
  • spring-boot
  • three.js
  • typescript
  • vite
Share this project:

Updates

Submission history