Skip to content

FengheTan9/U-Bench

Repository files navigation

U-Bench: A Comprehensive Understanding of U-Net through 100-Variant Benchmarking

Teaser



project arXiv github huggingface huggingface License: Apache2.0

SoTA paper & weights sharing πŸ€—

πŸ”₯πŸ”₯πŸ”₯ Welcome to share the paper, code and weights through the Issues and Discussions ! πŸ”₯πŸ”₯πŸ”₯

News

  • 25-10-16. U-Bench Model Zoo weights released [Quick Access] πŸŽ‰πŸŽ‰πŸŽ‰
  • 25-10-15. U-Bench Data Zoo released [Quick Access] πŸŽ‰πŸŽ‰πŸŽ‰
  • 25-10-08. U-Bench paper released πŸŽ‰πŸŽ‰πŸŽ‰

CatalogπŸš€πŸš€πŸš€

  • U-Bench Model Zoo weights πŸ€—πŸ€—πŸ€—
  • U-Bench Data Zoo πŸ€—πŸ€—πŸ€—
  • U-Bench code πŸ€—πŸ€—πŸ€—
  • U-Bench paper πŸ€—πŸ€—πŸ€—

Abstract

Over the past decade, U-Net has been the dominant architecture in medical image segmentation, leading to the development of thousands of U-shaped variants. Despite its widespread adoption, a comprehensive benchmark to systematically assess the performance and utility of these models is lacking, primarily due to insufficient statistical validation and limited attention to efficiency and generalization across diverse datasets. To address this gap, we present U-Bench, the first large-scale, statistically rigorous benchmark that evaluates 100 U-Net variants across 28 datasets and 10 imaging modalities. Our contributions are threefold: (1) Comprehensive Evaluation: U-Bench evaluates models along three key dimensions: statistical robustness, zero-shot generalization, and computational efficiency. We introduce a novel metric, U-Score, which jointly captures the performance-efficiency trade-off, offering a deployment-oriented perspective on model progress. (2) Systematic Analysis and Model Selection Guidance: We summarize key findings from the large-scale evaluation and systematically analyze the impact of dataset characteristics and architectural paradigms on model performance. Based on these insights, we propose a model advisor agent to guide researchers in selecting the most suitable models for specific datasets and tasks. (3) Public Availability: We provide all code, models, protocols, and weights, enabling the community to reproduce our results and extend the benchmark with future methods. In summary, U-Bench not only exposes gaps in previous evaluations but also establishes a foundation for fair, reproducible, and practically relevant benchmarking in the next decade of U-Net-based segmentation models.

Anaylsis🧐

(1) Trends Analysis

Teaser

(2) Significance Analysis

Teaser

(3) Data Characteristics Analysis

Teaser

Quick Start 🀩🀩🀩

Model Zoo Data Zoo
Code | Weights (Hugging Face) Data (Hugging Face)

1. Installation

git clone https://github.com/FengheTan9/U-Bench.git
cd U-Bench
conda create -n ubench python=3.9 -y  
conda activate ubench  
pip install -r requirements.txt  

2. Datasets

Please put the dataset (e.g. BUSI) or your own dataset as the following architecture:

└── U-Bench
    β”œβ”€β”€ data
        β”œβ”€β”€ busi
            β”œβ”€β”€ images
            |   β”œβ”€β”€ benign (10).png
            β”‚   β”œβ”€β”€ malignant (17).png
            β”‚   β”œβ”€β”€ ...
            |
            └── masks
                β”œβ”€β”€ 0
                |   β”œβ”€β”€ benign (10).png
                |   β”œβ”€β”€ malignant (17).png
                |   β”œβ”€β”€ ...
        β”œβ”€β”€ your dataset
            β”œβ”€β”€ images
            |   β”œβ”€β”€ 0a7e06.png
            β”‚   β”œβ”€β”€ ...
            |
            └── masks
                β”œβ”€β”€ 0
                |   β”œβ”€β”€ 0a7e06.png
                |   β”œβ”€β”€ ...
    β”œβ”€β”€ dataloader
    β”œβ”€β”€ models
    β”œβ”€β”€ utils
    β”œβ”€β”€ script
    β”œβ”€β”€ main.py
    └── main_multi3d.py

3. Training & Validation

# BUSI (in-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/busi --dataset_name busi
# BUSBRA (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/BUSBRA --dataset_name BUSBRA
# ISIC18 (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/isic18 --dataset_name isic18
# SkinCancer (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/uwaterlooskincancer --dataset_name uwaterlooskincancer
# Kvasir (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/Kvasir-SEG --dataset_name Kvasir-SEG
# CHASE (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/CHASEDB1 --dataset_name CHASEDB1
# DRIVE (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/DRIVE --dataset_name DRIVE
# DSB2018 (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/DSB2018 --dataset_name DSB2018
# GlaS (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/Glas --dataset_name Glas
# Monusac (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/monusac --dataset_name monusac
# Cell (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/cellnuclei --dataset_name cellnuclei
# Convidquex (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/covidquex --dataset_name covidquex
# Montgomery (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/Montgomery --dataset_name Montgomery
# DCA (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/dca1 --dataset_name dca1
# Cystoidfluid (In-domain)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/cystoidfluid --dataset_name cystoidfluid
# Synapse (3D-Slice)
python main_multi3d.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/synapse --dataset_name synapse --num_classes 9 --input_channel 3 --val_interval 100
# ACDC (3D-Slice)
python main_multi3d.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/ACDC--dataset_name ACDC --num_classes 4 --input_channel 3 --val_interval 100

4. In-domain Inference

U-Bench Model Zoo [Quick Access]

# BUSI
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/busi --dataset_name busi --just_for_test True

5. Zero-shot Inference

# BUSI -> BUS (zero-shot)
python main.py --max_epochs 300 --gpu 0 --batch_size 8 --model U_Net --base_dir ./data/busi --dataset_name busi --zero_shot_base_dir ./data/bus --zero_shot_dataset_name bus --just_for_zero_shot

5. U-Score calculator

Please refer U-Score calculator

6. Results

Teaser

Teaser

Citation

If using this work (dataset, weights, or benchmark results), please cite:

@article{tang2025u,
  title={U-Bench: A Comprehensive Understanding of U-Net through 100-Variant Benchmarking},
  author={Tang, Fenghe and Dong, Chengqi and Ma, Wenxin and Xu, Zikang and Zhu, Heqin and Jiang, Zihang and Wang, Rongsheng and Wang, Yuhao and Wu, Chenxu and Zhou, Shaohua Kevin},
  journal={arXiv preprint arXiv:2510.07041},
  year={2025}
}

Contact

For questions or collaborations:

⭐ Star this repo if you find it useful!

About

U-Bench: A Comprehensive Understanding of U-Net through 100-Variant Benchmarking

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages