Data augmentation toolkit
Actively maintained. Last release 5 weeks ago, commits in 9 of the last 26 weeks. A safe choice.
pip install batchgeneratorsbatchgenerators by MIC@DKFZ
Copyright German Cancer Research Center (DKFZ) and contributors.
Please make sure that your usage of this code is in compliance with its
license.
batchgenerators is a python package for data augmentation. It is developed jointly between the Division of Medical Image Computing at the German Cancer Research Center (DKFZ) and the Applied Computer Vision Lab of the Helmholtz Imaging Platform.
It is not (yet) perfect, but we feel it is good enough to be shared with the community. If you encounter bug, feel free to contact us or open a github issue.
If you use it please cite the following work:
Isensee Fabian, Jäger Paul, Wasserthal Jakob, Zimmerer David, Petersen Jens, Kohl Simon,
Schock Justus, Klein Andre, Roß Tobias, Wirkert Sebastian, Neher Peter, Dinkelacker Stefan,
Köhler Gregor, Maier-Hein Klaus (2020). batchgenerators - a python framework for data
augmentation. doi:10.5281/zenodo.3632567
batchgenerators also contains the following application-specific augmentations:
- Anatomy-informed Data Augmentation
Proposed at MICCAI 2023 for simulation of soft-tissue deformations. Implementation details can be found here. - Misalignment Data Augmentation
Proposed in Nature Scientific Reports 2023 for enhancing model's adaptability to diverse misalignments
between multi-modal (multi-channel) images and thereby ensuring robust performance. Implementation details can be found here.
If you use these augmentations please cite them too.
Supported Augmentations
We supports a variety of augmentations, all of which are compatible with 2D and 3D input data! (This is something that was missing in most other frameworks).
- Spatial Augmentations
- mirroring
- channel translation (to simulate registration errors)
- elastic deformations

