Sure, I will decrease the model and try.
Preprocessing mainly consists of
img = Image.open(path_to_image)

y = 1 if 'dog' in path else 0
if self.transform:
     img = self.transform(img)
return img, y

path is like …/input/train/dog.123.jpg or …/input/train/cat.456.jpg