Skip to main content

TDSC-ABUS2023 · PyTorch

A lightweight PyTorch Dataset for the TDSC-ABUS 2023 challenge
Tumor Detection, Segmentation and Classification on Automated 3D Breast Ultrasound

PyPI Python 3.9+ arXiv MIT License

Paper · Challenge · Quick Start · Citation

Axial slice with tumor mask and bounding box, next to the TDSCTumors crop

Figure 1. Case 8 (malignant). (a) Axial slice of the full volume returned by TDSC, with the tumor mask and bounding box. (b) The same tumor as returned by TDSCTumors, cropped to its bounding box.


Highlights

  • Zero setup. Each split is downloaded and extracted on first use, then cached locally.
  • Ready-to-train samples. Volumes, masks, labels and tumor bounding boxes, straight from dataset[i].
  • Tumor crops. TDSCTumors yields volumes already cropped to the tumor, for classification or patch-based segmentation.
  • Minimal dependencies. torch, numpy, pandas, pynrrd and gdown, nothing else.

Installation

pip install tdsc-abus2023-pytorch

Requires Python 3.9 or newer.

Quick Start

Full volumes

from tdsc_abus2023_pytorch import TDSC, DataSplits

dataset = TDSC(path="./data", split=DataSplits.TRAIN, download=True)
volume, mask, label, bbox = dataset[0]
Output Type Description
volume np.ndarray Full 3D ultrasound volume
mask np.ndarray Segmentation mask (0 background, 1 tumor)
label int 0 malignant, 1 benign
bbox ((x0, y0, z0), (x1, y1, z1)) Tumor bounding box in the volume's native coordinates

Tumor crops

from tdsc_abus2023_pytorch import TDSCTumors, DataSplits

dataset = TDSCTumors(path="./data", split=DataSplits.TRAIN, download=True)
volume, mask, label = dataset[0]

Anatomical views

ViewTransformer transposes each volume/mask pair into the requested anatomical plane.

from tdsc_abus2023_pytorch import TDSC, DataSplits, ViewTransformer, ViewTransposeConfig

dataset = TDSC(
    path="./data",
    split=DataSplits.TRAIN,
    transforms=[ViewTransformer(view=ViewTransposeConfig.CORONAL)],
)

Axial, coronal and sagittal views of the same tumor produced by ViewTransformer

Figure 2. Slice through the tumor of case 8 in each view produced by ViewTransformer: (a) axial, (b) coronal, (c) sagittal.

Custom transforms

Any callable (volume, mask) -> (volume, mask) works as a transform. Transforms run in the order given.

class MyTransform:
    def __call__(self, volume, mask):
        return volume, mask  # your logic here

dataset = TDSC(
    path="./data",
    split=DataSplits.TRAIN,
    transforms=[ViewTransformer(ViewTransposeConfig.AXIAL), MyTransform()],
)

Dataset

The dataset has 200 3D breast ultrasound volumes acquired with an Invenia ABUS system (GE Healthcare) at Harbin Medical University Cancer Hospital, China. Experienced radiologists annotated and verified the tumor masks and bounding boxes.

Split Cases Malignant Benign
Train 100 58 42
Validation 30 17 13
Test 70 40 30
Total 200 115 85
Property Value
Volume size 843×546×270 to 865×682×354 voxels
Voxel spacing 0.200 × 0.073 mm (X–Y), ~0.476 mm (Z)
File format .nrrd

With download=True, each requested split is fetched from Google Drive, extracted and cached under path/<Split>/. Later runs reuse the cached copy and don't touch the network:

data/
├── Train/
│   ├── DATA/            # volumes (.nrrd)
│   ├── MASK/            # masks (.nrrd)
│   ├── labels.csv
│   └── bbx_labels.csv
├── Validation/
└── Test/

API Reference

Class Returns Notes
TDSC(path, split, transforms, download) (volume, mask, label, bbox) Full volume and mask
TDSCTumors(path, split, transforms, download) (volume, mask, label) Cropped to the tumor bounding box
ViewTransformer(view) (volume, mask) ViewTransposeConfig.{AXIAL, CORONAL, SAGITTAL}
DataSplits — DataSplits.{TRAIN, VALIDATION, TEST}

split also accepts a plain string, for example split="Train".

Development

git clone https://github.com/mralinp/tdsc-abus2023-pytorch.git
cd tdsc-abus2023-pytorch
pip install -r requirements.txt pytest pytest-cov
pytest

The test suite runs offline against a small synthetic dataset and never downloads the real data. Contributions are welcome through pull requests.

Citation

If you use this dataset, please cite the challenge paper:

@misc{luo2025tumordetectionsegmentationclassification,
  title         = {Tumor Detection, Segmentation and Classification Challenge on Automated 3D Breast Ultrasound: The TDSC-ABUS Challenge},
  author        = {Gongning Luo and others},
  year          = {2025},
  eprint        = {2501.15588},
  archivePrefix = {arXiv},
  primaryClass  = {eess.IV},
  url           = {https://arxiv.org/abs/2501.15588}
}

License

The code is released under the MIT License. The dataset itself is provided by the TDSC-ABUS 2023 organizers and is subject to their terms of use.

Metadata

Release files for tdsc-abus2023-pytorch 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tdsc-abus2023-pytorch 0.2.1
File Size Uploaded
tdsc_abus2023_pytorch-0.2.1.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tdsc-abus2023-pytorch 0.2.1
File Interpreter ABI Platform
tdsc_abus2023_pytorch-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / tdsc_abus2023_pytorch-0.2.1.tar.gz

Download URL tdsc_abus2023_pytorch-0.2.1.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a62b6ed6e03314fc6a31418561700a210f983744de38d6752b466ed1ccee0dbe
BLAKE2b-256 checksum
How to use checksums
6f02b170b9f27d5d52bf0432000cb1f0d2bc9599ae6905fb8294eb0367ff960b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / tdsc_abus2023_pytorch-0.2.1-py3-none-any.whl

Download URL tdsc_abus2023_pytorch-0.2.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c09c72c2aa2564744aa264eaf8117df6d437732a388bd675396110ac2af1d7b6
BLAKE2b-256 checksum
How to use checksums
3f2a5d0725c56bc14fe93d06174dff909eaee85b50a81e82c835be8b689b6f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page