Monday, December 8, 2008

Genetic Algorithms and the Mona Lisa

Link to blog post by Roger Alsing

50 semi-transparent polygons, with vertex locations and color being determined by a genetic algorithm - evaluation function is a comparison to the actual Mona Lisa.

What's instructive here is the simplicity of the model: 4 parameters per polygon - 3 vertices and the color, for a total of 200 parameters. I'm guessing the evaluation consists of summing all the polygons and then doing some kind of image comparison - wonder how fast it runs?

The final result appears after close to a million iterations...but recognizable image occurs around 100,000 generations. Also, comments point out that the algorithm does not appear to be a standard "genetic" algorithm, but instead a stochastic hill-climbing algorithm.

Update:
FAQ by Roger Alsing
Source code
A Clojure version of the same approach

Another update:
A very detailed look at optimizing this image compression approach

No comments: