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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augmentation Transform | Patch Shuffling (ETA 8/27) #2701

Closed
finalelement opened this issue Aug 5, 2021 · 8 comments · Fixed by #2918
Closed

Augmentation Transform | Patch Shuffling (ETA 8/27) #2701

finalelement opened this issue Aug 5, 2021 · 8 comments · Fixed by #2918
Assignees
Labels
enhancement New feature or request Feature request

Comments

@finalelement
Copy link
Collaborator

finalelement commented Aug 5, 2021

Local pixel/voxel shuffling is a an augmentation that can be used during training, its essentially a way to add noise to the image. In brief the a small sub-block of pixels/voxels are selected from the entire image and then local pixels are shuffled to generate a noisy image

The expectation is to send an image and the transform should be able to shuffle pixels given the hyper-parameters of how many blocks should be shuffled

It should also be noted that pytorch also offers a Pixel Shuffle (https://pytorch.org/docs/stable/generated/torch.nn.PixelShuffle.html). That should not be confused with this one, as it shuffles the dimensions of the image and not sub-blocks/local block etc.

@finalelement finalelement self-assigned this Aug 5, 2021
@finalelement finalelement added enhancement New feature or request Feature request labels Aug 5, 2021
@finalelement finalelement changed the title Augmentation Transform | Pixel Shuffling Augmentation Transform | Local Voxel Shuffling Aug 5, 2021
@finalelement finalelement changed the title Augmentation Transform | Local Voxel Shuffling Augmentation Transform | Patch Shuffling Aug 5, 2021
@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 6, 2021

Hi @finalelement ,

Thanks for the feature request.
I am not very clear about the shuffle progress: do you mean to shuffle the pixels within selected block or shuffle the blocks in the entire image?

Thanks.

@deepib deepib changed the title Augmentation Transform | Patch Shuffling Augmentation Transform | Patch Shuffling (ETA 8/13) Aug 9, 2021
@finalelement
Copy link
Collaborator Author

Hi @Nic-Ma I mean to say the voxels/pixels are shuffled within a local patch. Please also share if you already see something similar already existing.

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 9, 2021

@finalelement , OK, we don't have such transform so far I think.
Please go ahead to implement your ideas.

Thanks in advance.

@Spenhouet
Copy link
Contributor

There might also be a method similar to RandomSwap coming.
To differentiate I would propose the following naming:

  • For the RandomSwap equivalent: RandPatchSwap
  • For the patch shuffling proposed here: RandPatchShuffle

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 10, 2021

Hi @Spenhouet ,

Thanks for your explanation, naming sounds to me.
@finalelement Do you have any other comments?

Thanks.

@finalelement
Copy link
Collaborator Author

finalelement commented Aug 12, 2021

I've created a pull request. The code has been added in this pull request.

This transform needs testcases and some more local testing, as well as how it has to be added to the dictionary.py

Updating the ETA to 08/20

@finalelement finalelement changed the title Augmentation Transform | Patch Shuffling (ETA 8/13) Augmentation Transform | Patch Shuffling (ETA 8/20) Aug 12, 2021
@finalelement
Copy link
Collaborator Author

Follow this in future for making this N-d

Also shifting the transform from spatial to intensity, due to it being a better fit as an intensity transform.

@deepib deepib changed the title Augmentation Transform | Patch Shuffling (ETA 8/20) Augmentation Transform | Patch Shuffling (ETA 8/27) Aug 23, 2021
@finalelement
Copy link
Collaborator Author

@wyli Thank you for all the support with this Issue. This current one supports 3D.

We will re-iterate on a new on a new PR with updated dev-branch for dictionary version and N-dimensional version of this transform.

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

Successfully merging a pull request may close this issue.

3 participants