Closed uptodiff closed 4 years ago
Hi, I'll release the proper code for this soon. But here is the list of augmentations(and their inverses) for now. I loop through each scale then perform each augmentation in that list and average the results. Then I perform a weighted average of the results at the different scales.
augmentations = [(lambda x: x, lambda x: x), (lambda x: scipy.ndimage.rotate(x,90),lambda x:scipy.ndimage.rotate(x, 270)), (lambda x: scipy.ndimage.rotate(x,180),lambda x:scipy.ndimage.rotate(x, 180)), (lambda x: scipy.ndimage.rotate(x,270),lambda x:scipy.ndimage.rotate(x, 90)),
(lambda x: x[:,::-1], lambda x: x[:,::-1]), (lambda x: scipy.ndimage.rotate(x[:,::-1],90),lambda x:scipy.ndimage.rotate(x, 270)[:,::-1]), (lambda x: scipy.ndimage.rotate(x[:,::-1],180),lambda x:scipy.ndimage.rotate(x, 180)[:,::-1]), (lambda x: scipy.ndimage.rotate(x[:,::-1],270),lambda x:scipy.ndimage.rotate(x, 90)[:,::-1]),
(lambda x: x[::-1], lambda x: x[::-1]), (lambda x: scipy.ndimage.rotate(x[::-1],90),lambda x:scipy.ndimage.rotate(x, 270)[::-1]), (lambda x: scipy.ndimage.rotate(x[::-1],180),lambda x:scipy.ndimage.rotate(x, 180)[::-1]), (lambda x: scipy.ndimage.rotate(x[::-1],270),lambda x:scipy.ndimage.rotate(x, 90)[::-1]),
(lambda x: x[::-1,::-1], lambda x: x[::-1,::-1]), (lambda x: scipy.ndimage.rotate(x[::-1,::-1],90),lambda x:scipy.ndimage.rotate(x, 270)[::-1,::-1]), (lambda x: scipy.ndimage.rotate(x[::-1,::-1],180),lambda x:scipy.ndimage.rotate(x, 180)[::-1,::-1]), (lambda x: scipy.ndimage.rotate(x[::-1,::-1],270),lambda x:scipy.ndimage.rotate(x, 90)[::-1,::-1])]
scales = [0.9, 1, 1.1]
scale_weights = np.array([0.15, 0.75, 0.15])
From the code above, flip and rotate operations are the main augmentations that used in TTA. Thanks for your early reply.
The effect of your proposed model and training method is really amazing. “This, combined with longer training at 45 epochs and TTA, has a bigger impact than the choices of loss functions”. It seems TTA also plays an important role. So I want to konw the detail of TTA, such as the example code or related info. Looking forward to your reply!