Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined Affine/Elastic augmentations #1052

Open
cfhammill opened this issue Mar 13, 2023 · 1 comment 路 May be fixed by #1073
Open

Combined Affine/Elastic augmentations #1052

cfhammill opened this issue Mar 13, 2023 · 1 comment 路 May be fixed by #1073
Labels
enhancement New feature or request

Comments

@cfhammill
Copy link

馃殌 Feature

A combined elastic/affine augmentation.

Motivation

Currently CPU use is training bottleneck for training a relatively large vision transformer, most of the time is spent in augmentation on sitk's resampling code, it looks like resampling is getting triggered once for each of the random affine and random elastic transformations.

Pitch

Two additional operations RandomAffineThenElastic, and RandomElasticThenAffine (I would use the later), where the two random transformations are merged and use only a single resampling.

Notes

Thanks for the great package!

@cfhammill cfhammill added the enhancement New feature or request label Mar 13, 2023
@fepegar
Copy link
Owner

fepegar commented Mar 29, 2023

Hi, @cfhammill. It would be a nice feature. Would you be available to contribute such a transform?

mrdkucher added a commit to mrdkucher/torchio that referenced this issue Apr 19, 2023
SimpleITK's ResampleImageFilter is an expensive operation,
especially when its called sequentially for both affine and
elastic transformations. By combining the SimpleITK transforms
for both augmentations, the processing time for a sample can be
reduced.

Currently the augmentation uses a combined probability for applying the
transform, rather than independently applying them.

Resolves: fepegar#1052
@mrdkucher mrdkucher linked a pull request Apr 19, 2023 that will close this issue
8 tasks
mrdkucher added a commit to mrdkucher/torchio that referenced this issue Apr 20, 2023
SimpleITK's ResampleImageFilter is an expensive operation,
especially when its called sequentially for both affine and
elastic transformations. By combining the SimpleITK transforms
for both augmentations, the processing time for a sample can be
reduced.

Currently the augmentation uses a combined probability for applying the
transform, rather than independently applying them.

Resolves: fepegar#1052
mrdkucher added a commit to mrdkucher/torchio that referenced this issue Aug 25, 2023
SimpleITK's ResampleImageFilter is an expensive operation,
especially when its called sequentially for both affine and
elastic transformations. By combining the SimpleITK transforms
for both augmentations, the processing time for a sample can be
reduced.

Currently the augmentation uses a combined probability for applying the
transform, rather than independently applying them.

Resolves: fepegar#1052
mrdkucher pushed a commit to mrdkucher/torchio that referenced this issue Aug 27, 2023
SimpleITK's ResampleImageFilter is an expensive operation,
especially when its called sequentially for both affine and
elastic transformations. By combining the SimpleITK transforms
for both augmentations, the processing time for a sample can be
reduced.

Currently the augmentation uses a combined probability for applying the
transform, rather than independently applying them.

Add combined affine and elastic deformation augmentation

SimpleITK's ResampleImageFilter is an expensive operation,
especially when its called sequentially for both affine and
elastic transformations. By combining the SimpleITK transforms
for both augmentations, the processing time for a sample can be
reduced.

Currently the augmentation uses a combined probability for applying the
transform, rather than independently applying them.

Resolves: fepegar#1052

Remove duplicated code

Update pytests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants