Using the SSIM index

Now, we'll repeat the experiment, but this time using the SSIM metric to measure the difference between the reference image and the reconstructed image. To make this happen, we'll modify the definition of getDiff(), as follows:

def getDiff(individual):    return imageTest.getDifference(individual, "SSIM"),

This experiment produced the following side-by-side milestones of the saved images:

Milestone results of Mona Lisa reconstruction using the SSIM index – part 1

The following image shows the results for the following generations:

Milestone results of Mona Lisa reconstruction using the SSIM index – part 2

The result seems ...

Get Hands-On Genetic Algorithms with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.