Open-Source Feasibility Report for Vein Ultrasound Analysis on Cloudflare Pages
United Veins has requested a feasibility assessment for building a web-based ultrasound image analysis platform focused on vein/vascular imaging, deployable on Cloudflare Pages.
Key findings:
We surveyed GitHub and academic repositories, identifying 30+ projects across five categories:
| Category | Projects Found | Maturity | Cloudflare Pages Compatible |
|---|---|---|---|
| Web DICOM Viewers | 9 | High | Yes |
| Ultrasound AI/ML Models | 7 | Medium | Via ONNX |
| Vascular-Specific Segmentation | 4 | Medium | Via ONNX |
| Browser ML Inference | 5 | High | Yes |
| Reporting / Structured Data | 4 | High | Yes |
| Project | Stars | License | Language | Best For |
|---|---|---|---|---|
| OHIF Viewer | ★ 4,131 | MIT | TypeScript | Full-featured viewer with extensions, measurement tools, 2D/3D. Gold standard. |
| Cornerstone3D | ★ 1,044 | MIT | TypeScript | Low-level rendering engine behind OHIF. Use for custom viewer builds. |
| dicomParser | ★ 743 | MIT | JavaScript | Lightweight DICOM parsing in the browser. Essential utility. |
| dcmjs | ★ 340 | MIT | JavaScript | DICOM manipulation + Structured Report generation in browser. |
| DWV | ★ 1,809 | GPL-3.0 | JavaScript | Simple zero-footprint viewer. Has React/Vue wrappers. Copyleft license concern. |
| NiiVue | ★ 443 | BSD-2 | TypeScript | Modern WebGL2 viewer. Good for 3D volume rendering. |
| Project | Stars | License | Key Advantage | Vein Relevance |
|---|---|---|---|---|
| UltraSam | ★ 127 | Custom | Foundation model trained on 43 ultrasound datasets (282K images, 58 anatomies) | High |
| MedSAM | ★ 4,220 | Apache-2.0 | SAM fine-tuned on 1.5M medical images. ONNX-exportable. 3D Slicer plugin. | High |
| UniUltra | ★ 19 | Custom | 94% parameter reduction vs SAM2. Ideal for edge/browser deployment. | High |
| OpenUS | ★ 26 | Custom | Largest public US dataset (308K images). Pre-trained backbone for fine-tuning. | Medium |
| MobileSAM | ★ 5,711 | Apache-2.0 | 7x smaller than SAM. Proven in-browser via ONNX Runtime Web. | Medium |
| Lightweight U-Net | ★ 26 | Custom | 420x smaller than U-Net. 30 FPS on CPU. Built for real-time ultrasound. | High |
| ASCENT | ★ 44 | Apache-2.0 | Cardiac US segmentation + Doppler. Relevant techniques for flow analysis. | Medium |
| Project | What It Does | Relevance to Vein Analysis |
|---|---|---|
| caroSegDeep | Arterial wall segmentation using Dilated U-Net on carotid ultrasound sequences | Directly applicable — vessel wall boundary detection is the same problem domain for veins |
| carotid-segmentation | U-Net model for carotid cross-sectional area measurement | Same measurement type needed for vein diameter assessment. GPL-3.0 license. |
| carotid-US-UNet++ | U-Net++ with uncertainty estimation and Grad-CAM explainability | Explainability (Grad-CAM) builds clinical trust. Apache-2.0 license. |
| ThinkSono (Reference) | Commercial AI for DVT (Deep Vein Thrombosis) detection via ultrasound | Market reference — validates demand. Published research on AutoDVT model. |
Running segmentation models directly in the browser keeps patient data on-device and eliminates server costs for inference.
| Project | Stars | What It Proves |
|---|---|---|
| MobileSAM-in-Browser | ★ 130 | Full SAM-style segmentation running in-browser via ONNX Runtime Web. MIT license. |
| SAM-in-Browser | ★ 81 | Original SAM model running in browser without any backend. |
| samexporter | ★ 399 | Exports SAM/MedSAM/SAM2 to ONNX format. Essential for model conversion pipeline. |
| ONNX Runtime Web | ★ 16,000+ | Microsoft's ML runtime with WebAssembly + WebGPU backends. The standard for browser ML. |
| Tool | Purpose | Deployment |
|---|---|---|
| dcmjs | Generate DICOM Structured Reports (SR) with measurements in the browser | Browser |
| jsPDF / pdfmake | Generate PDF reports client-side with charts, tables, and images | Browser |
| Awesome Radiology Reports | Research reference for AI-powered radiology report generation | Reference |
Reports can be generated entirely in-browser as PDF or DICOM SR, containing segmentation overlays, vessel measurements (diameter, wall thickness, flow velocity), and clinical notes.
Weeks 1-4
Weeks 5-10
Weeks 11-16
| Risk | Impact | Mitigation |
|---|---|---|
| Insufficient labeled vein training data | High | Start with MedSAM/UltraSam pre-trained weights; use interactive prompting (click-to-segment) to reduce data needs |
| Browser inference too slow on older devices | Medium | Use UniUltra (94% smaller) for browser; fallback to Workers AI API for heavy compute |
| DICOM format variability across scanners | Medium | dicomParser handles all standard transfer syntaxes; test with United Veins' actual scanner output early |
| Regulatory / medical device classification | High | Position as "clinical decision support" not diagnostic. Consult regulatory counsel. Include "not a medical device" disclaimers. |
| Model accuracy insufficient for clinical use | Medium | Keep human-in-the-loop: AI suggests, clinician confirms. Semi-automatic workflow. |
| Copyleft license contamination (GPL) | Medium | Avoid DWV (GPL-3.0). Stick to MIT/Apache-2.0/BSD stack: Cornerstone3D + MedSAM + dcmjs. |
| Layer | Technology | Role |
|---|---|---|
| Viewing | Cornerstone3D + dicomParser | DICOM rendering, annotations, measurements |
| Segmentation | MedSAM (fine-tuned) → ONNX | Vein boundary detection and measurement |
| Browser Inference | ONNX Runtime Web | Client-side model execution (WASM + WebGPU) |
| Reporting | dcmjs + jsPDF | DICOM Structured Reports + PDF generation |
| Hosting | Cloudflare Pages + Workers | Static site + optional serverless API |