Tuesday, December 09, 2008

Drawing the Mona Lisa with a Genetic Algorithm

I know I haven't posted much lately, but this is something that just really caught my attention.

A guy wanted to play around with genetic algorithms so he set out to try and recreate an approximation of the Mona Lisa using only 50 polygons, and he did a fantastic job!

If you are unfamiliar with genetic algorithms either you can read up on them here, you can read my description at the end, or you can simply not care and just check out the cool pictures!

You can read about it, as well as see an image from a select set of iterations, here.

The term Genetic Algorithm basically just describes a programming technique in which the developer takes an initial population or data set as the starting DNA pool, then essentially just allows the population to reproduce. This is done by various methods to include "cross over" and "mutation". In cross over, part of the DNA from one member in the data set or population, is combined with part of the DNA from another member, just as in human reproduction. The result is two new members of the next generation, each comprised of parts of their parents. Mutation generally occurs after cross over and is similar to a human birth defect in that the offspring's DNA is not merely comprised of its parents. This resulting mutation may or may not be beneficial to the survival. Once the new generation is formed, each member of the population is run through a fitness function. This takes those members that most closely approximate the desired end result and allows them to breed. This process continues until either you reach a maximum number of generations, or you have achieved your goal.

1 comment:

Jill said...

very cool. nice to see you blogged again. :-)