Skip to main content

Python wrapper for the BreastDivider left/right breast MRI segmentation model.

Project description

BreastDivider: A Large-Scale Dataset and Model for Left–Right Breast MRI Segmentation


📰 News

  • 04/26Released BreastDivider Model Pip package for easier use!
  • 08/25 – 📦 Dataset V2 released — now 17,956 cases with left/right as well as partial lesion segmentation masks, and over 3000 lesion classification targets
  • 08/25 – 🏆 Used in the winning solution of the ODELIA Breast Cancer Classification Challenge
  • 07/25Released BreastDivider Model and Dataset for public use
  • 07/25Accepted to MICCAI WOMEN 2025!

BreastDivider Overview


🧠 Introduction

Breast MRI plays a pivotal role in breast cancer detection, diagnosis, and treatment planning. BreastDivider addresses a critical limitation in breast MRI segmentation: the lack of distinction between the left and right breasts in most public datasets and models.

We introduce the first publicly available large-scale dataset with explicit left and right breast segmentation labels, now comprising over 17,000 3D MRI scans. Alongside, we provide a robust nnU-Net–based segmentation model, trained to reliably separate left and right breast regions in clinical MRI data.

This resource serves as a foundation for anatomically aware AI in breast MRI, enabling improved unilateral classification, treatment response evaluation, and post-mastectomy follow-up. It also supports large-scale pretraining for downstream tasks.


📂 Dataset and Model

BreastDivider includes:

  • 🔹 17,956 3D breast MRI scans with left/right segmentation masks, curated from 7 public datasets: Duke-Breast-Cancer-MRI, MAMA-MIA, Advanced-MRI-Breast-Lesions, EA1141, ODELIA, ISPY1, ISPY2
  • 🔹 Lesion annotations:
    • 3021 lesion classification targets
    • 467 lesion segmentation masks
  • 🔹 Pretrained nnU-Net model achieving 0.99 Dice in 5-fold cross-validation
  • 🔹 Docker container for seamless deployment and inference

📥 Links:


📂 Dataset Folder Structure

dataset/
├── imagesTr_batch1/
├── imagesTr_batch2/
├── labelsTr_batch1/
├── labelsTr_batch2/
├── lesion_annotations/
│   ├── classification/
│   └── segmentation/
  • imagesTr_batch*: Training images in .nii.gz format (split into two batches)
  • labelsTr_batch*: Left/right segmentation masks in .nii.gz format (split into two batches)
  • lesion_annotations/classification: classification.csv with lesion labels
  • lesion_annotations/segmentation: Lesion masks for bilateral images

Install

pip install breastdivider

Python Usage

from breastdivider import predict

predict(
    input_path="case_0000.nii.gz",
    output_path="case_seg.nii.gz",
)

For repeated inference, create and reuse a predictor:

from breastdivider import BreastDividerPredictor

predictor = BreastDividerPredictor(device="cuda")
predictor.predict(
    input_path="case_0000.nii.gz",
    output_path="case_seg.nii.gz",
)

CLI Usage

breastdivider predict case_0000.nii.gz case_seg.nii.gz --device cuda

To pre-download the model:

breastdivider download

Input Format

nnunetv2 expects single-channel files named like CASE_0000.nii.gz.

  • If you pass a directory, the package forwards it directly to nnunetv2.
  • Directory inputs with arbitrary .nii.gz filenames are automatically staged into nnU-Net's CASE_0000.nii.gz naming scheme before prediction.
  • If you pass a single .nii.gz file, the package temporarily stages it under the expected *_0000.nii.gz naming scheme before prediction.

Notes


📄 Citation

If you use this dataset or model in your work, please cite:

@article{rokuss2025breastdivider,
  title     = {Divide and Conquer: A Large-Scale Dataset and Model for Left–Right Breast MRI Segmentation},
  author    = {Rokuss, Maximilian and Hamm, Benjamin and Kirchhoff, Yannick and Maier-Hein, Klaus},
  journal   = {arXiv preprint arXiv:2507.13830},
  year      = {2025}
}

License

Note that while this repository is available under Apache-2.0 license (see LICENSE), the model checkpoint is Creative Commons Attribution Non Commercial Share Alike 4.0!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

breastdivider-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

breastdivider-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file breastdivider-0.1.0.tar.gz.

File metadata

  • Download URL: breastdivider-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for breastdivider-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98d1c1fab152f58083458b33cafa2fa406ef6406c0f2a11c88e48e24756771ca
MD5 2150d803334b287f57cfe741f2ad49bb
BLAKE2b-256 22c8a75bb3355b848a7de5db34d972cce987b6d9b3c6a58f124f4590e5be803a

See more details on using hashes here.

File details

Details for the file breastdivider-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: breastdivider-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for breastdivider-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1117e17ac31efc964a741176087c69fd59cb58cd97fb0573ecdc06efa2c8c963
MD5 3215a77f32b3735d81b1fcf5667cd853
BLAKE2b-256 fce16294847f6cf1a25f65545e45d0d6fd6b70a75f25000d3705dc3c6419d9aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page