Can I apply offline and online data augmentation at the same time? I have a dataset, that has nearly 3500 images highly class imbalanced. To make balanced classes, I applied python’s augmentor package and made it with 12000 images. I applied offline image augmentation here, and chose 1000 samples from each data folder. Now in my learning algorithm I already have online augmentation implemented in the DataLoader class. The code snippet is below:
type or paste code here
self.weak = tfs.Compose([
tfs.Resize(resize_shape),
tfs.RandomHorizontalFlip(),
tfs.RandomCrop(size=crop_shape, padding=int(crop_shape * 0.125), padding_mode='reflect')
])
self.strong = tfs.Compose([
tfs.Resize(resize_shape),
tfs.RandomHorizontalFlip(),
tfs.RandomCrop(size=crop_shape, padding=int(crop_shape * 0.125), padding_mode='reflect'),
RandAugmentMC(n=2, m=10)
])
self.normalize = tfs.Compose([
tfs.ToTensor(),
tfs.Normalize(mean=mean, std=std)])
Now my question is this process is improving the accuracy, but is this correct?