How To Breed A Face
Written by Alex Armstrong   
Sunday, 12 August 2012

The genetic algorithm is a way to create solutions to problems by mimicking the way that nature works. However, that doesn't mean it can't be fun! Pareidoloop is a program which uses a GA approach to create a face that satisfies a face recognition algorithm - and all using JavaScript.

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.

pareidoloop

Image:Philip Mccarthy

 

This is the idea behind Pareidoloop. It uses a face detection program written in JavaScript. This is taken from Liu Liu's  Core Computer Vision library which provides a range of image processing algorithms as well as face detection and is well worth knowing about.

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.

Why Pareidoloop?

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.

 

More Information

Pareidoloop

Code on GitHub

Related Articles

The Genetic Algorithm (program)
Genetic Algorithms (Theory)

Face Recognition

AI Can Find Long Lost Relatives

blog comments powered by Disqus

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.

 

Banner


Java JDK 9 Proposals
22/08/2014

Oracle has announced the first set of proposed improvements for inclusion in Java 9.



New Downloads For Raspberry Pi
16/09/2014

The Raspberry Pi Foundation has announced new releases of its OS Raspbian and the installer software that helps users to get started, NOOBS.


More News

Last Updated ( Sunday, 12 August 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.