Evolution of Mona Lisa

1 year, 3 months ago

Roger Alsing recently wrote an evolutionary algorithm that recreated the Mona Lisa out of only 50 semi transparent polygons. The results are an impressive testimony to the power of such an approach (the final image being the 904,314th generation):

Mona Lisa evolution

From his post:

This weekend I decided to play around a bit with genetic programming and put evolution to the test, the test of fine art :-)

I created a small program that keeps a string of DNA for polygon rendering.
The procedure of the program is quite simple:

0) Setup a random DNA string (application start)

1) Copy the current DNA sequence and mutate it slightly
2) Use the new DNA to render polygons onto a canvas
3) Compare the canvas to the source image
4) If the new painting looks more like the source image than the previous painting did, then overwrite the current DNA with the new DNA
5) repeat from 1

2 Responses to “Evolution of Mona Lisa”

  1. Juan Manuel says:

    Ok, I like it. But when you use a random way you lose power…

    That algorithm can be improved if you choice the mutation with your own system:

    1. Setup your own StringPersistent randomly
    2. Setup your StringLisa randomly too
    3. Copy StringLisa and mutate with StringPersistent orders
    4. Use the new one for rendering Lisa
    5. If the result is better change StringLisa
    6. Add 1 to a counter
    6. Repeat to 3 until you have enough
    7. Copy in your gallery the counter
    8. Repeat to 1 until you have enough

    Result: StringPersistent is the code that can recognize images…

  2. Josh says:

    Hi Juan,
    I’m definitely a fan of the idea of running these things with a reasonable large world population (i.e. evolution in parallel), with some heuristics to kill off bad mutations early.

    Though I think the advantage of allowing random mutations in parallel comes in allowing promising branches to grow, and being able to solve problems that are too complex to predict the success criteria for.

    A friend, Will P, is much more knowledgeable about such things. He’s had some good hands-on experience in GAs, and has some interesting ideas about competitive systems in general. Maybe he will give his thoughts?

Leave a Reply