DSA vessel segmentation
in-browser vessel segmentation
2 min readupdated
A model for binary brain vessel segmentation from digital subtraction angiography (DSA) images. It consists of five folds (ensemble parts) of 2D nnU-Net v2 trained with the clDice loss function and exported to ONNX format without weight modification. The key feature of the model is its ability to run directly in a web browser using ONNX Runtime Web without sending data to a server. This development is intended for research purposes and is not a medical device.
Key features
- Precise brain vessel segmentation based on the nnU-Net v2 architecture.
- Full browser compatibility via ONNX Runtime Web with WebGPU support.
- Five-fold ensemble for improved result accuracy.
- Support for optional test-time mirror augmentation.
What you can do
- Test the model locally in your browser through a demo application.
- Integrate ONNX models into web services for client-side medical image processing.
- Set up preprocessing and post-processing pipelines (Z-score, sliding window, Softmax) in Python or JavaScript.
Example
A minimal example of checking a single patch in Python using onnxruntime:
import numpy as np, onnxruntime as ort
s = ort.InferenceSession("vessel_seg_fold0.onnx")
x = np.zeros((1, 1, 896, 768), np.float32) # z-scored патч
logits = s.run(None, {"input": x})[0] # (1, 2, 896, 768)
vessel = logits[0, 1] > logits[0, 0]Read more
DetailsFramework: nnU-Net v2 (2d configuration, PlainConvUNet, 46.3 million parameters per fold).
File format: vessel_seg_fold{0..4}.onnx (fp32, about 185 MB each).
Performance: processing a single fold on WebGPU takes about 1.1 s, and the full 5-fold ensemble takes about 4.1 s.










Comments