Skip to content

Experiment: hybrid RampNet + open VLM (Qwen3-VL) — ensemble / cascade / distillation #35

Open

Description

@jonfroehlich

Motivation

RampNet is strong but not perfect — on the deployment benchmark it sits around P ~0.95 / R ~0.80, so ~1 in 5 real curb ramps is still missed. General VLMs now do bounding-box detection, and the model-comparison harness (#20, PR #34) lets us score them on the same ground truth. The question this issue tracks: can a hybrid of RampNet + an open VLM beat RampNet alone — at a cost an open-source, academically-hosted project can actually afford?

Project Sidewalk is open source, runs on academic servers, and has very little money, so "just call a paid VLM per pano" is off the table at deployment scale. That constraint isn't a blocker — it shapes the design.

The cost reframe: self-host the VLM

  • Gemini (paid API) → useful as a reference baseline, but never a deployment component (per-call cost × millions of panos).
  • Qwen3-VL (open weights) → self-hostable on makelab2 (A40, 48 GB, 24 TB) or Hyak; inference cost is GPU-hours, not dollars. This makes Qwen — not Gemini — the real hybrid partner.
  • Tiling wrinkle worth testing: the harness feeds the VLM 1024×1024 perspective tiles, not the full 4096+ pano. The "A40 OOMs Qwen at native res" concern (why Qwen was earmarked for Hyak) may not apply to tiled inference — so makelab2 could be self-sufficient here. Verify empirically.

Approaches (with the standard names)

Approach What it is Fit for us
Ensemble / late (decision-level) fusion — Weighted Boxes Fusion (Solovyev et al. 2019), NMS-fusion Run both, pool + merge detections weighted by confidence Best accuracy; pays VLM cost on every pano forever
Confidence-gated cascade (propose→verify) RampNet everywhere; VLM invoked only on RampNet's uncertain/empty panos to recover misses or prune FPs Bounds VLM calls to a fraction — budget-friendly
Offline distillation / pseudo-labeling (teacher→student, weak supervision) VLM improves the auto-generated training set once; deploy RampNet alone Free at inference; most on-brand for an auto-labeling project; most publishable

Decision gate — do this first (cheap, no training)

A hybrid only helps if the two models make different errors. Before building anything, run the complementarity analysis on the existing model-comparison run (cached detections + derived GT):

  • Oracle-union recall — recall if a ramp counts as found when either model finds it. Compare to RampNet's solo recall.
  • The "RampNet-miss ∩ VLM-hit" set — real ramps RampNet misses that the VLM catches (the upside), and the FP cost of taking the VLM's extra detections (the downside).
  • Verdict: if union recall materially exceeds RampNet's ~0.80 without a FP blowup → prototype a cascade. If not → it's a distillation story (VLM cleans the dataset), or not worth it.

Early data point (in-progress run): Gemini-3.6-flash tiling ≈ P 0.76 / R 0.65 on 70 richmond panos — below RampNet — so a naive union would add FPs. Whether the errors are complementary is the open question. Qwen numbers TBD (needs wiring, see #20).

Compute

  • makelab2 — A40 (48 GB), 24 TB; self-host Qwen3-VL (test tiled inference here first). Needs env setup (py3.12 + CUDA torch + transformers pin).
  • Hyak — for heavier runs / native-res if tiling proves insufficient.
  • Gemini — paid reference baseline only, via the harness.

Relation to other work

Builds directly on #20 (model-comparison harness) and PR #34 (docs/model_comparison.md, scripts/model_comparison/). The complementarity analysis reuses that harness's cached detections and rampnet/detection_eval.py ground truth — no new infra. Wiring Qwen3-VL (the prerequisite for a Qwen hybrid) is already a checklist item on #20.

Next steps

  1. Complementarity analysis on the current Gemini run (defines whether to proceed).
  2. Wire + self-host Qwen3-VL on makelab2 (test whether tiled inference fits the A40); rerun complementarity with Qwen.
  3. If promising: prototype the cheapest viable hybrid (likely a confidence-gated cascade or a distillation pass), measure vs RampNet-alone on the benchmark.

Filing to give the idea a home; not committing to build until the complementarity gate says it's worth it.

Activity

  1. jonfroehlich commented on Jul 23, 2026

    @jonfroehlich
    MemberAuthor

    Decision-gate results: RampNet vs Gemini (Flash-3.6, Pro-3.1) on the benchmark

    Ran the model-comparison harness (#20 / PR #34) on benchmark/{richmond,bend} for Gemini, then the complementarity analysis this issue gates on. Gemini is a paid reference baseline here, not a deployment candidate — Qwen (self-hosted) is still the real hybrid partner and is TBD. Numbers are operating-point P/R at the pano radius 0.022; RampNet's rows match its verdict-based cross-check, so the harness is self-validated.

    Solo scores (perspective tiling — the fair VLM input)

    model richmond P/R (F1) bend P/R (F1)
    rampnet 0.964 / 0.768 (.855) 0.961 / 0.761 (.850)
    gemini-3.1-pro-preview 0.631 / 0.700 (.664) (running)
    gemini-3.6-flash 0.626 / 0.642 (.634) 0.608 / 0.587 (.597)
    gemini-2.5-flash 0.235 / 0.258 (.246) 0.285 / 0.226 (.252)

    RampNet wins solo by a wide margin (F1 ~.85 vs the best VLM's ~.66). A frontier general VLM, even on its fair input, does not match the purpose-trained detector on this task.

    Reprojection is empirically justified: without tiling (whole-pano lower bound), gemini-3.6-flash recall collapses — richmond 0.642 → 0.268, bend 0.587 → 0.245 (~2.4× recall from the perspective reprojection, precision ~held). Ramps really are undetectable in the warped 4k equirect.

    Complementarity (richmond, 310 GT ramps) — the actual gate

    Does the VLM catch ramps RampNet misses?

    Flash-3.6 Pro-3.1
    Oracle-union recall (ceiling) 0.832 0.855
    Complementary gain (RampNet-miss ∩ VLM-hit) 20 27
    ...as % of RampNet's 72 misses 28% 38%
    FP cost 119 127
    Hard misses (neither model) 52 45

    Verdict

    1. Real but modest complementarity. Pro recovers 27 of RampNet's 72 misses (38%), lifting the recall ceiling to 0.855. Pro > Flash as a teacher (more recall, more complementary), though not more precise.
    2. Inference-time hybrid is out. Both VLMs bury ~25 good extra detections under ~120 false positives; a naive union drops F1 to ~0.74 — worse than RampNet alone. And VLM boxes carry no calibrated per-box confidence, so a simple confidence-gated cascade isn't even available without a separate verifier.
    3. → Offline distillation / pseudo-labeling is the surviving path. Harvest the VLM's complementary misses offline (a reviewer filters the FPs once), fold them into RampNet's training set → capture the extra recall at zero inference cost and zero FP penalty. This is the on-brand, budget-fit direction, and Pro is the better teacher.
    4. The ~14.5% "neither" ramps are a resolution/data-collection floor no VLM addresses.

    Caveats / next

    • Richmond only so far (Pro-bend + whole-pano still running); numbers should track. Will update if bend diverges.
    • Qwen3-VL is the one that matters for a deployable hybrid (self-hosted on makelab2/Hyak = free inference, unlike Gemini). Rerun this same analysis once Qwen is wired (Set up a harness for experimenting with newer detection models/backbones #20). If Qwen shows similar complementarity at higher precision, a cascade could reopen; if not, it's distillation.
    • Reproduce: python scripts/model_comparison/compare.py benchmark/<city> --models rampnet,gemini:gemini-3.1-pro-preview (+ the complementarity script).
  2. jonfroehlich commented on Jul 23, 2026

    @jonfroehlich
    MemberAuthor

    ⚠️ Provisional — a 2-city hypothesis, not a decision

    The results above are richmond (Mapillary/OOD) + bend (GSV/in-distribution) only. Two cities is a pattern, not a verdict — the "distillation over inference-time hybrid" read should be treated as a working hypothesis and re-tested across more geography, imagery sources, and ramp densities before we act on it.

    Next: expand the benchmark to more cities, starting with Clovis, NM (Mapillary/OOD, dense drive) so the harness scores a third city the same way. The conclusion may shift — or firm up — with broader coverage; nothing here is being locked in.

    Also still outstanding and potentially conclusion-changing: Qwen3-VL (the self-hostable, deployment-viable partner, unlike the paid Gemini baseline) — same complementarity read once wired (#20).

  3. jonfroehlich commented on Jul 24, 2026

    @jonfroehlich
    MemberAuthor

    Related: recall error analysis quantifies the "hard misses"

    A depth-quantified error analysis of RampNet's misses (posted in detail on #25) sharpens the picture behind this issue's complementarity numbers:

    • Recall is distance-limited: 0.88 within 12 m, 0.564 at 18–25 m, 0.182 beyond 25 m. RampNet is effectively blind past ~25 m.
    • That reframes the 45 richmond ramps neither RampNet nor Gemini-Pro found — they're largely a signal problem (too few pixels on target), not a model-architecture problem. No VLM rescues them, which is consistent with what we measured.
    • Precision is flat with distance (25 m+: 1.000), so the far-field deficit is purely false-negative.

    Implication for the hybrid question: the complementary-recall ceiling we measured (union 0.855) is bounded by imagery, not by model choice — which further supports the distillation over inference-time-hybrid conclusion, and points at sampling density / resolution as the higher-leverage direction than adding a second detector at inference time.

  4. jonfroehlich commented on Jul 24, 2026

    @jonfroehlich
    MemberAuthor

    Sharpening the cascade: the decision gate is answered, and the load-bearing piece is an arbiter-on-crop

    The complementarity gate this issue asks for now has data (OWLv2 leg, PR #40 / docs/model_comparison.md):

    • OWLv2 @ 0.05 floor: R 0.97, recovering 69 of RampNet's 72 misses on richmond.
    • RampNet ∪ OWLv2 oracle recall: 0.990 (vs RampNet's 0.768 solo).
    • Cost: ~128 FP per recovered ramp (vs ~6 for Gemini-3.6-flash).

    So the gate's verdict is: union recall massively exceeds RampNet's solo recall — but a naive union is unusable at 128:1 FP. That reframes the whole thing around one component this issue didn't originally name:

    An arbiter/verifier is load-bearing, and it should judge the actual crop. Decompose detection into (cheap high-recall proposal) + (per-crop verification): the generator (OWLv2, or a multi-model union) proposes; the arbiter looks at a tight crop around each proposal and answers ramp / not / unsure.

    Why this is more promising than end-to-end VLM detection:

    • It attacks the confound that makes VLMs flood FPs in the first place. They miss and hallucinate partly because a ramp is ~20 px in a 1024 px reprojected view. "Is this crop a ramp?" is a classification task VLMs are strong at, on a zoomed, centered image — a far more favorable decomposition.
    • RampNet already ships a ready arbiter. Stage 1's crop model (stage_one/crop_model/…) is a curb-ramp crop classifier — cheap, in-domain, already trained. Try it as arbiter checkpoint file #1 before spending VLM tokens; a VLM arbiter (Molmo/Qwen on the crop) is the stronger, costlier variant.

    Honest framing:

    • Recall ceiling = union recall of the generators (arbitration only removes, never adds): 0.990 for RampNet ∪ OWLv2, higher with Gemini/Molmo added.
    • Yardstick = FP-per-find after arbitration, not F1 (recall-first: FN is a permanent loss, FP is a cheap review). Target: push OWLv2's 128:1 below Gemini's ~6:1 while keeping most recovered ramps.
    • Evaluate the arbiter in isolation on held-out crops (the Stage-1 crop pipeline already does exactly this), so we're not tuning it on the detection test set.

    The failure-taxonomy pass (#46) directly de-risks this: if OWLv2's ~8,800 FPs are mostly hood/driveway/obvious junk, the arbiter's job is easy; if they're ambiguous concrete, it isn't. Worth running #46 before prototyping the cascade. The nadir/hood mask (#47) also shrinks the generator's FP flood at the source.

  5. changed the title [-][P3] Experiment: hybrid RampNet + open VLM (Qwen3-VL) — ensemble / cascade / distillation[/-] [+]Experiment: hybrid RampNet + open VLM (Qwen3-VL) — ensemble / cascade / distillation[/+] on Jul 24, 2026
  6. added this to the RampNet 2.0 milestone on Sep 21, 2026
  7. 36 remaining items

  8. added 3 commits that reference this issue on Nov 15, 2026
  9. added 2 commits that reference this issue on Nov 25, 2026
  10. jonfroehlich commented on Nov 25, 2026

    @jonfroehlich
    MemberAuthor

    Record of option B1 (confirm or drop a per-rig threshold and an open-weight second arm for open imagery) and its Stage 0 run.

    Plan. open-weight-cascade-confirm-2026-11-15.md, written and reviewed on 2026-11-15 (not in the repo). Three policies for curb-ramp labels on Mapillary and Panoramax imagery: N, RampNet at 0.30; T, a per-rig threshold; C, an open-weight YOLO pano arm that promotes RampNet peaks below 0.30. C is always compared with the better of N and T. Stage 0 is a CPU screen on the four GoPro Max splits (laurens_mapillary, bayonne, budapest_district5, morgantown), with Lyon (Stage 1) and Kaysville (Stage 2) held back as confirmation sets. Its steps and rules are reproduced verbatim in Appendix A of docs/cascade_confirm_35.md, and the instruction that kept Lyon and Kaysville unread is in Appendix B.

    Run. Stage 0 ran on 2026-11-15: #293 (scripts/analysis/cascade_confirm_35.py, analysis_out/cascade_confirm_35/stage0.json). No model call, no spend.

    Result: N under the rules as coded. T is dropped: the rig key test does not pass, and pooled held-out T − N is −0.022 [−0.038, −0.003]. C is dropped: pooled held-out C − max(N, T) is +0.027 [+0.007, +0.043] with the folds' counts summed, against a +0.03 bar, with wins on 2 of 4 splits. The whole gain is from laurens_mapillary and bayonne.

    Open. The plan does not define "pooled". Read as the mean of the four per-split deltas, C − max(N, T) is +0.0313 [+0.0088, +0.0465]: C survives, the outcome is "C only", and Stage 1 (Lyon) would follow. Which reading governs is Jon's call; it is set out in the PR and the doc. Until then, Stage 1 and Stage 2 are not run.

    🤖 Generated with Claude Code — Opus 5.5, claude-opus-5-5

  11. added 2 commits that reference this issue on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions