Lightweight MobileNetV2-UNet for Breast Ultrasound Image Segmentation
Wenyang Qiu, Ethan Hamburg, Yinkun Zhou, and Yaser Esmaeili Salehani
Concordia University, Montréal, Canada
Email: [email protected]
Overview
This repository contains the official implementation of “Lightweight MobileNetV2-UNet for Breast Ultrasound Image Segmentation.” The proposed model replaces the standard U-Net encoder with a MobileNetV2 backbone pretrained on ImageNet and pairs it with a compact decoder built from depthwise-separable convolutions. A controlled ablation study shows that popular bottleneck additions (SE attention, transformer layers, multi-scale fusion) do not improve accuracy on these datasets, confirming that the pretrained encoder alone provides sufficient feature capacity.
Patient-level evaluation (ICASSP 2027 submission)
The earlier results below used an image-level split. BUS-BRA contains two images for 811 of its 1,064 patients, so an image-level split places images of the same patient in both training and test sets (60.6% of test images in our earlier split). All four models were therefore retrained and re-evaluated on a patient-level split:
- Split:
splits/{train,val,test}.csv — patient-grouped (BUS-BRA Case), pathology-stratified, seed 42; 744/160/160 patients, 1,315/282/278 images; no patient appears in more than one split.
- Protocol: Adam (lr 1e-4, weight decay 5e-4), batch 8, 80 epochs, ReduceLROnPlateau, BCE–Dice loss, 3 runs (seeds 43–45); checkpoint selected on validation mIoU.
- mIoU = lesion IoU averaged over thresholds 0.50:0.05:0.95, computed per image.
| Model |
Dice (%) |
mIoU (%) |
Prec. (%) |
Params (M) |
GMACs |
CPU (ms) |
| U-Net |
83.90 ± 0.57 |
71.55 ± 0.49 |
86.45 ± 0.95 |
7.76 |
13.75 |
97.3 |
| Attention U-Net |
85.13 ± 0.61 |
72.86 ± 0.79 |
87.85 ± 0.37 |
7.89 |
13.95 |
120.1 |
| ResNet18-UNet |
87.69 ± 0.51 |
76.62 ± 0.45 |
88.28 ± 0.31 |
12.69 |
3.43 |
70.1 |
| MobileNetV2-UNet |
87.54 ± 0.14 |
75.91 ± 1.28 |
87.70 ± 0.44 |
2.38 |
0.50 |
28.9 |
Mean ± sample std over 3 runs on the held-out test split. CPU latency: batch 1, 4 threads, float32, Intel Xeon @ 2.00 GHz (Google Colab).
Patient-level paired tests (n = 160, Bonferroni over 3 comparisons): MobileNetV2-UNet vs U-Net and Attention U-Net, p_adj < 0.001 (t-test); vs ResNet18-UNet, t-test p_adj = 1.00 but Wilcoxon p_adj = 0.009 in favour of ResNet18-UNet.
Reproduce:
experiments/v2/1_mobilenetv2_unet_v2.ipynb … 4_resnet18_unet_v2.ipynb — train each model and write per-image results (clean + simulated speckle).
experiments/v2/5_analysis_v2.ipynb — CPU/GPU latency, patient-level statistics (scripts/stats.py), speckle figure.
python scripts/make_table1.py results/v2/*_per_image.csv — Table 1 rows from the per-image results.
python scripts/stats.py results/v2/*_per_image.csv — patient-level paired tests, bootstrap 95% CIs of the Dice differences, and the speckle summary.
Per-image results, latency measurements and the speckle figure are in results/v2/.
Key Results (earlier image-level split — superseded by the section above)
| Dataset |
Model |
Dice (%) |
mIoU (%) |
Params (M) |
| BUS-BRA |
Base U-Net |
87.44 ± 0.51 |
76.22 ± 0.75 |
7.76 |
| BUS-BRA |
Attention U-Net |
87.54 ± 0.38 |
76.06 ± 0.42 |
7.76 |
| BUS-BRA |
ResNet18-UNet |
89.09 ± 0.51 |
79.16 ± 0.27 |
12.69 |
| BUS-BRA |
MobileNetV2-UNet (ours) |
89.40 ± 0.15 |
78.92 ± 0.58 |
2.38 |
| BUSI |
Base U-Net |
67.65 ± 0.60 |
55.06 ± 0.21 |
7.76 |
| BUSI |
Attention U-Net |
73.22 ± 1.22 |
58.71 ± 0.79 |
7.76 |
| BUSI |
ResNet18-UNet |
76.98 ± 0.85 |
64.50 ± 0.62 |
12.69 |
| BUSI |
MobileNetV2-UNet (ours) |
74.89 ± 1.76 |
61.40 ± 1.04 |
2.38 |
All results are 5-run averages under identical hyperparameters, loss functions, and data splits.
Highlights
- 2.38M parameters, 0.46 GFLOPs — 5.3× smaller than ResNet18-UNet, 3.3× smaller than standard U-Net
- 89.40% Dice on BUS-BRA — highest among all four models tested
- Statistically comparable to ResNet18-UNet (p=0.219) at a fraction of the size
- Negative ablation result: SE, Transformer, and MSF modules add parameters but not accuracy
- Two-dataset evaluation: BUS-BRA (1,875 images) and BUSI (647 images)
Datasets
This study uses two publicly available breast ultrasound datasets:
Both datasets are split 80/20 using stratified sampling on pathology label.
Model Architecture
The proposed MobileNetV2-UNet consists of:
- Encoder: MobileNetV2 pretrained on ImageNet (all layers fine-tuned)
- Bottleneck: 1×1 convolution reducing 1280 channels to 96
- Decoder: 3 transposed-convolution upsampling stages with depthwise-separable convolution blocks
- Skip connections: MobileNetV2 layers {1, 3, 6} (16, 24, 32 channels at strides 2, 4, 8); layer 13 (96 channels) sets the bottleneck width but is not used as a skip
- Regularization: Dropout (p=0.3) after bottleneck
- Output: 1×1 convolution producing single-channel logit map
Training Configuration
All models share the same training setup:
| Setting |
Value |
| Optimizer |
Adam (lr=1e-4, weight_decay=5e-4) |
| Batch size |
8 |
| Epochs |
80 |
| Loss |
Hybrid BCE + Dice (equal weights) |
| LR Scheduler |
ReduceLROnPlateau (patience=3, factor=0.1) |
| Runs |
5 independent runs per model per dataset |
| GPU |
NVIDIA V100 |
Setup and Installation
Prerequisites
- Python 3.11 or later
- CUDA-compatible GPU
Installation
git clone https://github.com/maxwellqiu/Lightweight_U-Net.git
cd Lightweight_U-Net
pip install kagglehub pandas numpy opencv-python matplotlib torch torchvision albumentations scikit-learn
Usage
Training
import torch
from torch.utils.data import DataLoader
from models.UNet import UNetBaseline
from utils.datasets import BusbraDataset
from utils.metric import BCEDiceLoss
from utils.training import train
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = UNetBaseline(in_ch=1, out_ch=1).to(device)
train_dataset = BusbraDataset(df=train_df, img_size=(256, 256), transform=train_transform)
val_dataset = BusbraDataset(df=val_df, img_size=(256, 256), transform=val_transform)
train_loader = DataLoader(train_dataset, batch_size=8, shuffle=True)
val_loader = DataLoader(val_dataset, batch_size=8, shuffle=False)
criterion = BCEDiceLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=1e-4, weight_decay=5e-4)
scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, 'max', patience=3, factor=0.1)
history, best_iou, best_dice, best_prec = train(
model=model,
device=device,
train_loader=train_loader,
val_loader=val_loader,
criterion=criterion,
optimizer=optimizer,
scheduler=scheduler,
num_epochs=80,
save_path='best_model.pth'
)
Visualizing Predictions
from utils.visualization import predict_compare, plot_history_loss
model.load_state_dict(torch.load('best_model.pth'))
predict_compare(model, device, val_loader, num_samples=5)
plot_history_loss(history)
Ablation Study
Tested on BUS-BRA. All variants share the same encoder and decoder; only the bottleneck changes.
| Configuration |
Dice (%) |
mIoU (%) |
Params (M) |
| Base (proposed) |
89.40 ± 0.15 |
78.92 ± 0.58 |
2.38 |
| Base + SE |
88.52 ± 0.59 |
78.40 ± 0.69 |
2.38 |
| Base + SE + Trans |
89.05 ± 0.20 |
78.51 ± 0.33 |
2.81 |
| Base + SE + Trans + MSF |
88.57 ± 0.20 |
77.95 ± 0.42 |
3.10 |
None of the additions improve over the base model.
Citation
If you find this work useful, please cite:
@article{qiu2025lightweight,
title={Lightweight MobileNetV2-UNet for Breast Ultrasound Image Segmentation},
author={Qiu, Wenyang and Hamburg, Ethan and Zhou, Yinkun and Esmaeili Salehani, Yaser},
year={2025}
}
License
This project is for academic research purposes.
评论