|How To Breed A Face|
|Written by Alex Armstrong|
|Sunday, 12 August 2012|
The basic idea of the GA is simple enough. Start with a representation of a solution as a sequence of bits that can be combined in the same way as DNA, i.e. using exchange and mutation. Next set up a population of solutions and test them against the problem. Finally weed out the poor performers and allow the best of the rest to mix their genetic material to product the next generation of solutions.
If you go through enough generations the solutions should keep getting better as the population evolves towards a better fitness.
Next code up a way to generate random polygons such that the representation can take part in the GA. This part of the program is based on an earlier experiment with trying to breed the Mona Lisa - see Roger Alsing’s Evolution of Mona Lisa.
All you have to do next is to run the GA and use the output of the face detection program as the measure of fitness of each individual in the population. Keep the generations turning over and eventually you will reach a reasonable arrangement of polygons which activates the face detection algorithm - i.e. it looks like a face.
This is the term for the phenomenon of seeing things like faces in random textures. I'm not sure that this is quite Pareidoloop in that the input isn't random as it is being designed for the purpose.
Is there any purpose to this?
Unlikely, but it is a good demonstration of the GA in action and the images it creates are kind of spooky. There might be a call for artistic renderings of the eigenface of face detection, but mostly it's just fun.
or email your comment to: firstname.lastname@example.org
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
|Last Updated ( Sunday, 12 August 2012 )|