ThorMed Innovation and UT Dallas · 2025 to now

Ultrasound Segmentation for Portable Devices

The problem

Bladder volume shows whether a patient is retaining urine. It’s usually measured with a catheter, which risks infection. Ultrasound can measure it without one if a model can outline the bladder in the image, on a device small enough for the bedside.

No public bladder ultrasound dataset exists, so we worked from 486 images labeled for this project. A model that runs on a small device also needs its weights compressed.

The paper is joint work with Andrew Vu, Dr. Eric Chou and Dr. Gregory Thoreson of Baylor University Medical Center, and Dr. Katherine Brown at UT Dallas.

Building the labels

Outlining the bladder by hand on every frame is slow, so I built a pipeline that drafts the labels. It runs SAMUS, an ultrasound version of Segment Anything, on each frame and cleans up the mask it returns. A radiologist then graded the masks by hand before any model trained on them.

From a video frame to a checked label
Frameresized to 256 × 256
SAMUSone point prompt at the center
ThresholdOtsu on a smoothed probability map
Clean updrop specks, fill holes, keep the largest region
Radiologistgraded by hand

The models

I trained U-Net models with four encoders, from ResNet34 down to MobileNetV2 and EfficientNet-B0. Each encoder started either from ImageNet weights or from weights I pretrained on 9,204 thyroid and breast ultrasound images from the public US30K collection. US30K has no bladder images.

The experiment, end to end each model trained five times, once per fold
Pretrain encoder9,204 thyroid and breast images
Fine-tune on bladder389 images, 5 folds
Quantize weights8-bit and 4-bit, no retraining
Score97 held-out images
Run once from each starting point, for all four encoders.

Then I quantized each trained model’s weights to 8 and 4 bits without retraining and scored it again on 97 held-out images. The score is Dice, the overlap between the predicted outline and the labeled one.

What it showed

At full precision the starting point barely matters. Every model scores between 95.4 and 96 percent Dice. At 8 bits nothing moves by more than a point. At 4 bits the ImageNet models fall far behind.

Dice at 4-bit weights, by encoder ImageNet startultrasound start
ResNet34
70.9 92.7
ResNet18
54.5 91.5
MobileNetV2
56.4 75.5
EfficientNet-B0
10.9 76.0
Mean test Dice over the five fold models. Every model scored between 95.4 and 96 before quantization.
Test Dice at each precision mean over five fold models, 97 held-out images
EncoderStart32‑bit8‑bit4‑bit
ResNet34ImageNet95.5795.4870.88
Ultrasound95.7895.7792.73
ResNet18ImageNet95.4895.4654.49
Ultrasound95.8295.8091.45
MobileNetV2ImageNet95.4595.1456.40
Ultrasound95.9995.8475.49
EfficientNet-B0ImageNet95.5195.3010.88
Ultrasound95.6295.3776.01
From Tables 1 and 2 of the paper. Ultrasound start means supervised segmentation pretraining on the US30K subset.

Models that started from ImageNet dropped as low as 11 percent, on EfficientNet-B0. Models that started from ultrasound kept between 75 and 93 percent.

Breast ultrasound

On the public BUSI breast ultrasound dataset, I trained an attention U-Net and tested it on 156 images it never saw during training or checkpoint selection.

Test Dice by class attention U-Net, 156 held-out images
Benign86
0.72
Malignant37
0.62
Normal33
0.42
All156
0.63
A normal scan has no lesion, so it scores 1 only when the model draws nothing.

Normal scans have no lesion, but the model drew one on more than half of them. Those false alarms account for a third of the lost Dice, from a fifth of the test images.

Next

Next I want to run the 4-bit models on real hardware, since the compression so far is simulated, and check predicted volumes against catheter measurements.