To generate the image, the algorithm compared its own work to those in the data set until it could not tell them apart.