Inspiration

Field Bench helps a rockhound, field collector, or lapidary hobbyist name a stone from a photo, and then shows the physical test that separates it from the lookalike. Most identifier apps give one confident answer. A photograph cannot replace hardness, streak, or a lab result, so Field Bench is honest about that: confidence never exceeds 96%.

What it does

  • Identifies a stone from a photo against a catalog of about 60 species, on iPhone and in Chrome.
  • Shows Mohs hardness, luster and streak, the closest lookalike, and the physical test that separates them (for example, a drop of vinegar makes manganoan calcite fizz while rose quartz does not react).
  • When the evidence is ambiguous, it lists its best guesses with the diagnostic tests that settle them instead of faking certainty.
  • Saves specimens to a collection with form, notes, weight and origin.
  • Free to try: five scans a day and 20 saved specimens, with no purchase required.
  • The result screen names which route answered: on-device Apple Intelligence, Gemini looking at the photo, Gemini ranking the color brief, or the color shortlist alone.

How we built it

Firebase AI Logic performs every Stage 2 identification. The browser and the iPhone do not hold a Gemini API key. The default cloud model is gemini-3.5-flash-lite, and the Remote Config key gemini_model_name can change it without a new build.

Stage 1 is the same on both clients. The device measures specimen color and builds a shortlist. That step is not a language model.

iPhone (Swift, SwiftUI, SwiftData). Stage 2 calls Firebase AI Logic at runtime. A capable phone first ranks a measured color brief with Apple's on-device Foundation Model. That call is text only, so the photo is not attached to it. The app then sends the photograph to Gemini through the same Firebase client on every scan. If Gemini does not return a catalog rank, the on-device color rank is kept and capped at 70%. If both calls fail, the screen stays on the color shortlist and says so. A missing or placeholder GoogleService-Info.plist does not crash the app; it degrades to that shortlist.

Chrome (React). Stage 2 also calls Firebase AI Logic at runtime. Gemini Nano ranks the color brief in the browser when desktop Chrome can run it. The photo stays in the browser only when that rank reaches cloud_escalation_threshold (Remote Config). The result names the route: on_device, cloud_text, cloud_vision, or shortlist.

Firebase. App Check is required by Firebase AI Logic. Debug builds use the App Check debug provider, which the hackathon accepts. Release iOS builds use App Attest, or DeviceCheck when App Attest is unavailable. Opt-in corrections use anonymous Authentication and write labels to Cloud Firestore; the security rules reject photo fields. The local dataset export can still contain JPEGs, and that file stays on the device unless the user shares it.

Challenges we ran into

On iPhone, a color-only rank was finishing the scan before Gemini ever saw the stone. Scans now always send the photograph to Gemini after the on-device color rank.

In Chrome, color-only Gemini Nano ranks were confidently wrong: in testing, Nano ranked a labradorite as graphite and a malachite as talc from color alone; with the photo, Gemini named the labradorite and a rose quartz at 95%. A color brief caps Nano at 70%, and the Remote Config threshold is set to 0.75, so today every Chrome scan sends the photo to cloud Gemini. Lowering the threshold in Remote Config brings back the browser-only path without a new deploy.

What we learned

A color brief alone is not enough for an on-device model to name a stone reliably. Keeping the escalation threshold in Remote Config let us move between on-device and cloud routes without shipping a new build.

What already existed, and what was built during the submission period

This is an existing iOS app. Before this period it already captured a specimen, shortlisted it by color, identified it with a direct on-device Apple Intelligence call, saved a collection, offered lookalike tests, and sold a higher scan limit with StoreKit.

During the submission period, Stage 2 was replaced with a runtime Firebase AI Logic call on iPhone, and a Chrome client was added for the same catalog. iPhone scans now send the photograph to Gemini after the on-device color rank. Chrome keeps the hybrid threshold in Remote Config. App Check, Remote Config, anonymous Authentication, and Firestore rules for label-only corrections were added. The free tier was left in place so a judge can use the app without paying.

Built With

  • apple-foundation-models
  • chrome
  • cloud-firestore
  • firebase
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-remote-config
  • gemini
  • gemini-nano
  • react
  • storekit
  • swift
  • swiftdata
  • swiftui
Share this project:

Updates

Submission history