If you are dealing with target images and would like to apply the same random transformations on both the data and target, you could use the functional API as described in this post.
This would make sure to keep the correspondence between the data and target.
1 Like