Autoencoder implementation using ImageDataGenerator
As the following images from the paper shows, during training time you create patches from larger images. These patches have no defects and can therefore be seen as 'good' images. To get the accompanying 'bad' images with defects you synthetically generate these defects on the 'good' images.

Your data generator should therefore follow the following steps:

Read in full size 'good' images
Create patches from the full size images
Synthetically add defects to the patches from step 2
Return both the 'good' patches from step 2 and 'bad' patches from step 3

You then train your model using the 'bad' patches as the input and your 'good' patches as the output.