TDSC-ABUS2023 · PyTorch
A lightweight PyTorch Dataset for the TDSC-ABUS 2023 challenge
Tumor Detection, Segmentation and Classification on Automated 3D Breast Ultrasound
Paper · Challenge · Quick Start · Citation
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.
TDSCTumorsyields volumes already cropped to the tumor, for classification or patch-based segmentation. - Minimal dependencies.
torch,numpy,pandas,pynrrdandgdown, 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)],
)
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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tdsc_abus2023_pytorch-0.2.3.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tdsc_abus2023_pytorch-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / tdsc_abus2023_pytorch-0.2.3.tar.gz
| Download URL | tdsc_abus2023_pytorch-0.2.3.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3580624d3bd7ec71cf9543803c21f822f945460953c83889692ed47852d3e956
|
|
BLAKE2b-256 checksum How to use checksums |
32e4b1901ca8fe0d83fc0cec00384374f94f1f2b5551c3dcf23cac31f7352294
|
| 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 Oct 2, 2026.
Transparency logRelease files / tdsc_abus2023_pytorch-0.2.3-py3-none-any.whl
| Download URL | tdsc_abus2023_pytorch-0.2.3-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7180f420d40ceeb52f25cf8e8a0fd2d416afcdd7b77aa20cb9d5f35862086e73
|
|
BLAKE2b-256 checksum How to use checksums |
1fb026bce590d06b5a1a28f89c0e71d6255550a08c8ccba1defbb10022e52fcf
|
| 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 Oct 2, 2026.
Transparency log