The transformation module \(\mathcal {H}\)  for contrastive learning composes of a long series of random transformations and another short series of random transformations, where each series is responsible for generating one view in a positive pair (following the common practice as used in FixMatch [1]}).
The long series of random transformations includes a uniformly random cropping, a random horizontal flip, a random colour distortion, and a random grey scale operator.
Uniformly random cropping keeps the original image from 50% to 100% in terms of area, and it has been implemented in Pytorch [2]} as “torchvision.transforms.RandomResizedCrop”.
Random horizontal flip has 50% chance to flip the image.
Random colour distortion has also been realized in Pytorch [2]} as “torchvision.transforms.ColorJitter”, and we set the factors for brightness, contrast, saturation to \(0.4\) , and the factor for hue is set to \(0.1\) .
Last, with a chance of 20%, the image is converted to gray scale, and this operator is implemented as “torchvision.transforms.RandomGrayscale” in Pytorch [2]}.
On the other hand, the short series of random transformations comprises of a uniformly random cropping and a random colour distortion. The implementation is the same as the long series of random transformation, except the cropping area is set to 75% to 100%, the factors for brightness, contrast, saturation to \(0.2\) , and the factor for hue is set to \(0.05\) .
