Ultrasound Image Analysis Platform

Open-Source Feasibility Report for Vein Ultrasound Analysis on Cloudflare Pages

Prepared by: Customertimes Client: United Veins Date: April 20, 2026 Classification: Confidential

Table of Contents

  1. Executive Summary
  2. Requirements Analysis
  3. Open-Source Landscape
  4. DICOM Viewers & Web Libraries
  5. AI/ML Segmentation Models
  6. Vascular-Specific Projects
  7. Browser-Based ML Inference
  8. Reporting & Structured Data
  9. Proposed Architecture
  10. Implementation Roadmap
  11. Risks & Mitigations
  12. Recommendation

1. Executive Summary

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.

Verdict: Feasible. No single open-source project provides end-to-end vein ultrasound analysis as a web app. However, mature, actively maintained components exist for every layer of the stack — DICOM viewing, AI-powered segmentation, and report generation — that can be composed into a deployable solution on Cloudflare Pages with a lightweight Workers backend for heavy inference.

Key findings:

2. Requirements Analysis

Core Capabilities Needed

  • Upload and view vein ultrasound images (DICOM, PNG/JPEG)
  • AI-assisted vein segmentation and measurement
  • Vessel diameter, wall thickness, and flow measurements
  • Automated or semi-automated report generation
  • Web-based — no software installation required

Technical Constraints

  • Cloudflare Pages — static site hosting (HTML/JS/CSS/WASM)
  • Cloudflare Workers — serverless functions for API needs
  • Patient data must not leave the browser where possible (privacy)
  • Open-source licensing compatible with commercial use
  • Must handle standard vascular ultrasound DICOM formats

3. Open-Source Landscape Overview

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

4. DICOM Viewers & Web Libraries

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.
Recommendation: Use Cornerstone3D as the rendering foundation with dicomParser and dcmjs for DICOM I/O. This gives maximum flexibility for a custom vein analysis UI while staying MIT-licensed.

5. AI/ML Segmentation Models

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
Recommendation: Start with MedSAM (best license, largest community) or UltraSam (best ultrasound-specific performance). Fine-tune on vein ultrasound data from United Veins. Export to ONNX via samexporter for browser deployment.

6. Vascular-Specific Projects

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.
Note: No open-source project exists specifically for vein (venous) ultrasound analysis. The carotid/arterial projects use the same imaging modality and segmentation approach, making them strong starting points that require fine-tuning on venous data.

7. Browser-Based ML Inference

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.
Key Insight: Browser-based segmentation is proven and production-ready. A fine-tuned UltraSam/MedSAM model exported to ONNX can run client-side, meaning patient ultrasound data never leaves the user's device — a major privacy and compliance advantage.

8. Reporting & Structured Data

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.

9. Proposed Architecture

+-----------------------------------------------------------------------+ | CLOUDFLARE PAGES (Static) | | | | +------------------+ +------------------+ +---------------------+ | | | Cornerstone3D | | ONNX Runtime | | Report Generator | | | | DICOM Viewer | | Web (WASM/GPU) | | (dcmjs + jsPDF) | | | | | | | | | | | | - Image render | | - UltraSam/ | | - DICOM SR output | | | | - Annotations | | MedSAM ONNX | | - PDF reports | | | | - Measurements | | - Segmentation | | - Measurements | | | | - Pan/Zoom | | - Vessel detect | | - Clinical notes | | | +--------+---------+ +--------+---------+ +---------+-----------+ | | | | | | | +----------------------+----------------------+ | | | | | +-------------+-------------+ | | | dicomParser + dcmjs | | | | (DICOM I/O in browser) | | | +---------------------------+ | +-----------------------------------------------------------------------+ | (optional, heavy inference only) | +-----------------------------------------------------------------------+ | CLOUDFLARE WORKERS (API) | | | | +------------------+ +------------------+ +---------------------+ | | | Workers AI or | | R2 Storage | | Auth / Session | | | | External GPU | | (DICOM archive) | | Management | | | | (full model) | | | | | | | +------------------+ +------------------+ +---------------------+ | +-----------------------------------------------------------------------+

Key Design Decisions

10. Implementation Roadmap

Phase 1: Viewer + Upload

Weeks 1-4

  • Cornerstone3D viewer on CF Pages
  • DICOM + image upload
  • Basic measurement tools
  • Annotation overlay

Phase 2: AI Segmentation

Weeks 5-10

  • Fine-tune MedSAM on vein data
  • Export to ONNX
  • In-browser inference
  • Vessel measurement extraction

Phase 3: Reports + Polish

Weeks 11-16

  • PDF/DICOM SR report generation
  • Clinical notes templates
  • Workers API for heavy inference
  • User testing with United Veins
Critical dependency: Phase 2 requires labeled vein ultrasound training data from United Veins to fine-tune the segmentation model. Early data collection is essential.

11. Risks & Mitigations

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.

12. Recommendation

We recommend proceeding with a phased approach using the following core stack:

Recommended Stack (All MIT/Apache-2.0 Licensed)

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

Immediate Next Steps

  1. Data collection: Request sample vein ultrasound DICOM files from United Veins for format validation and model training
  2. Prototype: Deploy Cornerstone3D viewer on Cloudflare Pages with DICOM upload (1-2 weeks)
  3. Model evaluation: Benchmark MedSAM and UltraSam on United Veins' sample images to select the best base model
  4. Regulatory review: Engage counsel on medical device classification in target markets