Inspiration

Someone rings at the door and says they work for a delivery company. Most of us cannot check that claim: we do not know what that company's staff wear this month, what they drive, or what they are allowed to ask for. Impostors rely on exactly that gap. Asking for an ID card does not help either: a citizen cannot verify it, and nobody should have to show their identity to a stranger's phone.

We wanted a check that works on what is visible and what the organization itself says is normal, and that never tries to identify the person.

What it does

Contexivra has two sides.

The organization uses a web console in Chrome. It adds a few photos of what its staff wear and drive. Each photo is read by Gemini, on-device in Chrome when possible. The administrator sees, photo by photo, what was read, validates or sets it aside, and the references are proposed from the validated photos: uniform, logo placement, vehicle, equipment, expected actions. The organization adds the actions its staff never do, such as asking for payment at the door, and publishes a dated version. The last five versions are kept and any of them can be applied again.

The citizen uses an Android app with one action: choose a video. The app reads a few frames, merges the readings by vote, recognizes the organization from the logo or the vehicle marking, compares with the published reference, and answers in two or three words: Looks consistent, Check further, Do not proceed, with one piece of practical advice. Details are one tap away: each cue, what was seen, what was expected, and whether inference ran on the phone or in the cloud.

It never identifies anyone. "Looks consistent" means the cues match, not that the person is genuine

How we built it

  • Firebase AI Logic hybrid inference in both clients, with the three modes exposed in the settings: on-device only, prefer on-device, cloud only.
    • Console (Angular, Firebase JS SDK): image to JSON constrained by a schema, with Gemini Nano built into Chrome or the cloud model.
    • Android (Kotlin, Jetpack Compose): three calls per check , read each frame (image to JSON), compare meanings between the reference and the readings (text only), and write the advice (text only).
  • The model reads; rules decide. The model's answer is validated strictly and rejected if malformed. The critical cue (a prohibited action) and the overall outcome are computed by deterministic, unit-tested rules. The model's comparison of meanings is used only on non-critical visual cues and can never turn "not visible" into a match. The warning for a critical discrepancy is fixed text, not generated.
  • Never judge on one image. Video frames and reference photos are merged by vote, so one wrong reading cannot decide.
  • Firestore holds references and versions behind security rules; Authentication signs administrators in by email and the app anonymously; App Check protects the cloud model; Hosting serves the console.
  • A local environment with the Firebase Emulator Suite in Docker, and a build switch between local and deployed.
  • Demo scenes are drawn by code (a faceless mannequin and a fictional brand), so no real person or trademark appears anywhere.

Challenges we ran into

  • On-device inference would not start in Chrome (Personal Laptop) although the API reported the model as available. The cause was the graphics driver: Chrome had fallen back to software rendering. Upgrading the driver fixed it, and we added a diagnosis button to the console.
  • The Firebase AI libraries required a newer Kotlin than the Android Studio template; the project did not compile until we raised it.
  • One wrong reading distorted a whole result: a polo read as a "vest", or as a "shirt" when a payment terminal hid the collar. Voting across frames, clearer definitions in the prompt, and letting the model compare meanings rather than words made the result stable on our scenes.
  • We have no phone that supports Gemini Nano (Personal phone) . On-device inference is therefore demonstrated in Chrome; on Android we show the real cloud call and the fallback, and we say plainly that the on-device path on Android is not verified.
  • Scope. Our first idea included body shape and a confidence score about the individual. We dropped both: they are biometric, and they do not tell a real worker from an impostor.

Accomplishments that we're proud of

  • A complete loop on two platforms: an organization publishes a reference in Chrome, and seconds later a phone compares a video with it.
  • A clear split between what a model may do and what it may not, enforced in code and tested.
  • A result a non-technical person can act on: two or three words and one piece of advice.

What we learned

  • Hybrid inference is a privacy feature before it is a cost feature: staff photos and a video taken at someone's door are exactly the data that should stay on the device.
  • Text-against-text comparison by a model is far more forgiving than word matching, but it needs hard limits around it.
  • App Check and device support decide what a hackathon project can actually demonstrate; test them on day one.

What's next for Contexivra

  • A device at the door that watches a live stream instead of an imported video, with frame selection and a voice assistant.
  • Free-form cues proposed by the model, beyond the current fixed list.
  • Masking on the device before any cloud call, and a badge check against a registry.
  • A consented pilot with one organization: synthetic scenes say nothing about accuracy on real footage.

Built With

Share this project:

Updates

Submission history