@eqy Ok let me explain about the project I’m working on. I’m trying to classify Pneumonia patients using X-ray copies. Below mentioned are the transforms I’m currently using.
transform = {

   'train' : T.Compose([

                        T.Resize(size=(224,224)),

                        T.RandomAffine(30),

                        T.RandomInvert(p=1),

                        T.RandomHorizontalFlip(),

                        T.ToTensor(),

                        T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])

   ]),

   'valid' : T.Compose([

                        T.Resize(size=(224,224)),

                        T.RandomInvert(p=1),

                        T.ToTensor(),

                        T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])

   ])

}

Before you may ask why am I using Invert transform on the validation set, I think this transform is able to capture the pneumonia parts in the x-ray copies. So, I used it on validation and test set as well (If it is a bad idea the correct me). After applying  the transforms the images look something like this:

68ac12a3-19c8-4c71-9e00-46c9fcc9248d670×686 101 KB


87aede22-f1af-4713-be47-59db9804d1bf670×686 98.6 KB


311762ab-ee6c-438c-b216-9c1bbccdd958670×686 113 KB