SENTINEL · SEGMENTATION
🔥 Fire Watch ← Console

How Sentinel uses segmentation

Segmentation = labelling every pixel of a frame. Sentinel runs it two ways, both on-device in the browser (WebGPU): a tiny custom fine-tuned model for one threat class, and the SAM 3 foundation model to segment & track anything. This page explains both pipelines and when we use each.

Two models, one capability

Custom fine-tuned model SPECIALIST

A small model (LR-ASPP MobileNetV3, ~12 MB ONNX) trained for one job: fire vs. not-fire, per pixel.

  • Fast & tiny → real-time on the edge
  • Trained to ignore fire-coloured look-alikes (sunsets, brake lights) — the moat
  • Powers the console's Fire alerts + the fire-activity timeline
  • Needs a training pipeline (below)

SAM 3 foundation model GENERALIST

Meta's Segment Anything 3 — segment & track any object by a click, box, or text prompt. Zero-shot, no training.

  • Segment & track the subject of any alert (vehicle, crowd, person)
  • Promptable: click an object → instant mask, on-device
  • No labels, no training — a pretrained foundation model
  • Heavier per-frame → great interactive, not yet 30 fps video

What segmentation is

Both models share the encoder–decoder shape: an encoder compresses the image into semantic features ("what"), a decoder upsamples back to full resolution ("where"), and skip connections carry fine detail across so boundaries stay sharp.

ENCODER downsample · "what" DECODER upsample · "where" INPUT 512² PER-PIXEL MASK enc 1enc 2enc 3 BOTTLENECK lowest-res · richest semantics dec 1dec 2dec 3 skip connection skip connection skip connection

Encoder blocks (left) downsample to a low-res bottleneck (richest semantics); decoder blocks (right) upsample back to a full-resolution per-pixel mask; skip connections carry fine detail straight across so boundaries stay crisp.

Our fire model is exactly this. SAM 3 uses a heavier transformer (Hiera) encoder run once per image, then a fast promptable decoder that turns a click/box/text into a mask — which is why interaction is instant but the first encode takes a beat.

Pipeline A — building the custom fire model

No public fire-segmentation dataset existed, so we built one. This is the exact pipeline behind the Fire alerts:

01 · DATA

Synthetic generation

843 images via Grok/xAI, deliberately over-weighting hard negatives (sunset, brake lights, lava, neon).

→
02 · LABELS

Auto-labelling

Grounded-SAM (Grounding-DINO + SAM) localizes flame; a warm/hot colour gate refines to flame pixels.

→
03 · TRAIN

Fine-tune + DR

LR-ASPP MobileNetV3, weighted loss, domain randomization (JPEG, blur, chyron bars, broadcast-text overlays) + real harvested frames.

→
04 · EXPORT

ONNX

Export to a ~12 MB ONNX graph; inputs ImageNet-normalized 512², output 2-class logits.

→
05 · EDGE

WebGPU

onnxruntime-web runs it in the browser, ~44 ms/frame — no server, no data leaves the device.

→
06 · PRODUCT

In the console

Auto-applied to fire alerts; powers the jump-to-fire timeline (every frame scored).

The moat is in step 01. Detecting orange is trivial; not false-alarming on sunsets/brake-lights is the hard part. Over-weighting hard negatives is what teaches the decision boundary — validated at 0% false fire on held-out sunsets, neon, lava, and autumn foliage, while still detecting real flame.

Pipeline B — SAM 3 (foundation, no training)

For everything other than fire, we don't train a model — we prompt a foundation model:

01

Pretrained SAM 3

Trained by Meta on the huge SA-Co concept dataset — already knows objects.

→
02

Load on-device

transformers.js + WebGPU pulls the ONNX (q4 encoder) into the browser. One-time download.

→
03

Encode frame

The alert's keyframe is embedded once (~3–4 s).

→
04

Prompt

Click / box / text → segment that object. ~66 ms per prompt.

→
05

Track

Propagate the mask across frames to follow the subject (vehicle, crowd).

In the console, open any alert and use “Segment subject (SAM 3)” in the drawer — click the vehicle, person, or crowd in the source frame and SAM 3 masks it on-device. No labels, no training, works on objects the fire model never saw.

Specialist vs generalist — when we use which

Custom fire modelSAM 3
TaskOne class (fire), per-pixelAny object, promptable + concepts
TrainingFull pipeline (synth → label → train)None — zero-shot
Size / speed~12 MB · ~44 ms/frame (real-time)Large · ~3–4 s encode, 66 ms/click
Best forThe known threat, at video rateAd-hoc “segment that” on any alert
The moatYes — hard-negative discriminationGenerality & speed-to-new-class
Runs on-device?Yes (WebGPU)Yes (WebGPU)

The pattern (research §1/§7/§8): a foundation model for breadth + a tiny fine-tuned specialist for the known threat at the edge. SAM 3 lets us stand up a new capability in seconds; the custom pipeline hardens the one threat that has to run fast and never cry wolf.

Everything here runs in your browser on WebGPU — no inference server, no footage leaves the device. That's the edge/defense story: deployable to a disconnected field node.