Downloads · 30 days
0
callumtilbury/bubble-distill-v2
bubble-distill-v2 is a machine learning model from callumtilbury. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
TinyBubbleNet — a 389K parameter distilled student for microbubble segmentation.
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
4.8 MB
Likes
0
Public
Click a slice to open those files.
.pt4.8 MB · 99%
From the Hugging Face model README
TinyBubbleNet — a 389K parameter distilled student for microbubble segmentation.
| Property | Value |
|---|---|
| Architecture | Depthwise-separable U-Net (Cellpose-compatible) |
| Params | 388,580 |
| Size | ~4.6 MB |
| base_ch | 16 |
| Input | Grayscale microscopy images |
| Output | 4 channels: dY, dX, cell_prob, dist_transform |
Cellpose-SAM-FT → pseudo-labels on 50 lab images → TinyBubbleNet distillation
import torch
from model import TinyBubbleNet
model = TinyBubbleNet(in_channels=1, base_ch=16, out_channels=4)
checkpoint = torch.load("best_model.pt", map_location="cpu")
model.load_state_dict(checkpoint["model_state_dict"])
# For inference, see:
# https://huggingface.co/callumtilbury/bubble-distill
best_model.pt — trained model weights (epoch 282, val_loss=0.00083)model_and_train.py — full training script with model, loss, dataset definitions| Model | Params | Size | Inference @ 256² |
|---|---|---|---|
| Cellpose-SAM | ~300M | 1.1 GB | ~100 ms |
| TinyBubbleNet | 389K | ~1.5 MB | ~3 ms |
~750× smaller, ~33× faster — specialized for your exact lab domain.
When image style changes, re-annotate 2-3 images, re-finetune the teacher, regenerate pseudo-labels, and re-train the student in ~30 minutes.
Distilled from Cellpose-SAM-FT using pseudo-labels on microbubble-images.