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
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.
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).
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.





Runs client-side via onnxruntime-web (WASM). Nothing leaves your device.
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.
Measured, on held-out people
Evaluated against expert vein masks on people never seen during training (split by person — no leakage).
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.