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]

Faster loading

The volumes ship as gzip-compressed NRRD, so every read decompresses about 200 MB. Pass cache=True to convert each file to an uncompressed .npy next to it on first access. Later reads memory-map that file: TDSC skips decompression, and TDSCTumors reads only the tumor region. DataLoader workers share the OS page cache. The cache takes about 1.5x the disk space of the NRRD files.

dataset = TDSCTumors(path="./data", split=DataSplits.TRAIN, cache=True)
loader = torch.utils.data.DataLoader(dataset, batch_size=1, num_workers=4)

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.2

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.2
File Size Uploaded
tdsc_abus2023_pytorch-0.2.2.tar.gz 14.3 kB Details

Built distribution (wheel)

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

Total release size: 26.6 kB

Release files / tdsc_abus2023_pytorch-0.2.2.tar.gz

Download URL tdsc_abus2023_pytorch-0.2.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6e7dc8f9009f06b5fbeb756dcb9c21754ad99d10d2e44da501fcd17c098458d8
BLAKE2b-256 checksum
How to use checksums
34552c105d26b2eeea6dae15eec879dd9f0392e115a017de953ea8990eaa738b
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.2-py3-none-any.whl

Download URL tdsc_abus2023_pytorch-0.2.2-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0d0f37ad65fba62b8816b3a41e026c22dd26a7563ff20e163eb994aafdc36ca
BLAKE2b-256 checksum
How to use checksums
586d83765c22e914d260d462c9fd0f91bde8f9f1b3253c265b65923569b36d5a
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

This release

0.2.2 This release

2 release files

0.2.1

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