This java-applet uses a genetic-inspired algorihtm to produce facelike 3d structures.

A genetic algorithm works by having a fitness function evaluating genes in a gene pool. Here you will be the fitness function! Click on the face that you think looks the most like a face. In a some iterations you will (hopefully) end up with a number of face-like images.

Start by clicking in the applet area to update the screen!

How does it work?

We depart from a gene pool consisting of half-sphere shapes. When a face is chosen, we start the cross-over process. First choose two parents. They are picked randomly from the gene pool, it is a 50 per cent chance that the father will be substituted for the face we chose. Thus the selected face has a stronger selective advantage in the reproduction.

Crossover works by randomly select an entire row of coordinates from either parent one or parent two. (A sphere is constructed from coordinates on levels parallell to the equator of the circle; meridians. This is the indivisible gene that is chosen from either parent).

Thereafter, the children are randomly mutated. The mutation strategy consists in adding [-1,0,+1] to the 3d coordinates of the triangles that make up the sphere.

That's it!


The fun part about this is that this very generic algorithm can be used to construct almost any art. I got the inspiration to this program from reading about someone who had created a program that painted random lines on a screen. The artist thought of something he/she wanted to write and always selected the image that most closly resembled his/hers intentions. It could be anything, a frog, a spaceship etc!

I think this shows two things about genetic algorithms. Firstly, that they can converge very quickly, even if the algorithm is very simple, and secondly, that the way you code your problem can affect the result a great deal. In this case the coding does not resemble how the human genes encode a face. Our genes varies such parameters as bone length (actually, for how long certain regions will grow) and such a coding would probably be able to generate much more human-like faces.

Another thing to notice is how we humans over interpret images. We think that almost anything that is round and symetrical looks like a face. This is why we made the two halves of the face symetrical. Still, it isn't necessary for the algorithm to work.

Lars Rasmusson 1996-07-03