IV FINDER
Near-infrared vein segmentation · runs live in your browser

A neural net that finds veins — trained from scratch, running right here.

Nurses struggle to find veins for IV lines. Under near-infrared light veins show up as dark lines; I trained a small neural network to segment them, and it runs live below — in your browser, and on-device in an Android app.

RESEARCH DEMO · NOT A MEDICAL DEVICE

01 · the problem

Veins are invisible in normal light

Under a phone camera you can't see subcutaneous veins. Under ~850 nm near-infrared, blood absorbs the light and veins appear as dark lines.

02 · what I built

A trained segmentation model

A 0.75M-parameter U-Net trained on 2,000+ real NIR forearm images with expert vein masks. Hand-written computer vision couldn't do this (see below).

03 · try it

Run it yourself, right now

Pick an NIR sample below and the model segments the veins in your browser (~350 ms). The cyan overlay is the expert's answer — compare.

NIR samples
Live camera
loading model…
NIR samples
NIR forearm sample
NIR forearm sample
NIR forearm sample
NIR forearm sample
NIR forearm sample
1 · NIR input
2 · model output
3 · detected veins
0.50
inference input vein pixels IoU vs expert

Runs client-side via onnxruntime-web (WASM). Nothing leaves your device.

01

Why a trained model? Hand-written code can't do it

The classical computer-vision detector (ridge filters, thresholds) lights up the whole frame — arm edges, background, everything — so it can't tell you where the vein is. The trained model concentrates on the actual vein, matching the expert mask.

Three columns per row: NIR forearm, hand-written CV scattering everywhere, trained model localizing the veins
Middle column is the hand-written detector (scatters → IoU ≈ 0.015). Right column is the trained model (localizes the vein → IoU ≈ 0.25–0.30). Same images, same expert masks.
02

Measured, on held-out people

Evaluated against expert vein masks on people never seen during training (split by person — no leakage).

0.015Hand-written CV — IoUbarely finds veins
0.25Trained model — IoU0.30 @ best threshold
≈17×Improvementsame images + masks
~350msIn-browser inference0.75M params · CPU/WASM
03

What this is (and isn't)

How it works

  • A compact U-Net trained on the public CUBITAL NIR forearm dataset (2,016 images / 1,008 people), split by person.
  • Focal-Tversky loss so it survives the ~0.6% vein-pixel prevalence.
  • Exported to ONNX (this demo) and TFLite — the same model verified to run on-device inside the Android app.

Honest limits

  • NIR only. Ordinary cameras block near-infrared; without ~850 nm light there is no vein signal (that's why the camera tab won't find veins).
  • Not clinical. Engineering verification on public data — not validated for patient care.
  • IoU ~0.3 on thin veins is resolution-bounded; the clinical recommendation in the app stays gated until real validation.