Skip to main content

Ultrasound-specific image transforms for training deep neural networks.

Project description

USAugment

Binder arXiv

Examples of each augmentation.

USAugment provides ultrasound-specific image transforms for training deep neural networks. It accompanies our article Revisiting Data Augmentation for Ultrasound Images.

Checkout the Wiki to find the documentation, usage examples, and contributing guidelines.

How to install USAugment

This package can be installed from PyPI by running:

pip install usaugment

Get started using USAugment

Here add a quick code demo showing how to compose a multiple augmentations together using Albumentations after the package is installed.

>>> import albumentations as A
>>> from usaugment.albumentations import DepthAttenuation, GaussianShadow, HazeArtifact, SpeckleReduction
>>> transform = A.Compose(
...     [
...         DepthAttenuation(p=0.5),
...         GaussianShadow(p=0.5),
...         HazeArtifact(p=0.5),
...         SpeckleReduction(p=0.5),
...     ],
...     additional_targets={"scan_mask": "mask"}
...)
>>> transformed = transform(image=image)

Checkout the Documentation for more detailed examples and information about scan masks.

Running the examples

There's a notebook in the notebooks directory that provides examples that visualize the effects of each augmentation. You can run these examples using Binder (see the tag at the top of page) or locally by installing the optional examples dependencies (Matplotlib and Jupyter Notebook):

pip install '.[examples]'

Contributing

I'd love for this package to grow and flourish into a resource that anyone with an interest in training deep neural networks for ultrasound analysis tasks can pick up and use quickly and easily. Any help addressing bugs, contributing new augmentations, or any other improvements are welcome and appreciated! I only ask that you respect the community guidelines laid out in the CODE_OF_CONDUCT.md. For more information on how to contribute, checkout out the Documentation.

To ensure that your code meets the style guidelines etc., make sure you install the optional development dependencies:

pip install '.[dev]'
nbstripout --install
pre-commit install

How to cite USAugment

If you use the augmentations in USAugment in your research, please cite our article Revisiting Data Augmentation for Ultrasound Images. This helps more people find and use the package and encourages us to continue maintaining and improving it!

@misc{tupper2025,
      title={Revisiting Data Augmentation for Ultrasound Images}, 
      author={Adam Tupper and Christian Gagné},
      year={2025},
      eprint={2501.13193},
      archivePrefix={arXiv},
      primaryClass={eess.IV},
      url={https://arxiv.org/abs/2501.13193}, 
}

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

usaugment-1.0.1.tar.gz (568.3 kB view details)

Uploaded Source

Built Distribution

usaugment-1.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file usaugment-1.0.1.tar.gz.

File metadata

  • Download URL: usaugment-1.0.1.tar.gz
  • Upload date:
  • Size: 568.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for usaugment-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2249fa56a188cce7bf81103412bb9c7593918319c73a9861c877dc8a62ebf107
MD5 92a28e11feeea6f2f05e5de786a9a011
BLAKE2b-256 caaa592d1bc4c146bec9abb4ad38c495a19ace426b9005a2e9931cb5c40a566c

See more details on using hashes here.

Provenance

The following attestation bundles were made for usaugment-1.0.1.tar.gz:

Publisher: python-publish.yml on adamtupper/usaugment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file usaugment-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: usaugment-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for usaugment-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a5531fab4ac6fbf3a6ad7e023585e03663ff2754f21af72574d0a5301e44905
MD5 d2326c50f4018a0b7f6b913f4f14e135
BLAKE2b-256 d2d5e7788caa43c6dd23c3116f13f94ea0a15473ccf29289b1dbec9419833f0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for usaugment-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on adamtupper/usaugment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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