Thanks for the update. The transformation look alright assuming that image_sample contains the image and mask tensors. Random_Horizontal_Flip is missing the return statement, but I assume that’s just a copy-paste issue.