The Evolution of a Spaceship

Email:Kenneth Stanley / My Homepage


It is sometimes hard to imagine how phenotypic features emerged from nothing. When did legs appear? What about feet? What was the nature of the intermediate forms? In telling the story of the artificial evolution of a spaceship, this page offers a rare glimpse at how form evolves, and how increasing genetic complexity adds entirely new features to the phenotypic form.

The evolutionary run that produced the increasingly complex spaceships below took place in a program called NEAT-based Genetic Art (NBGA), produced by Mattias Fagerlund and based on Delphi NEAT , which is a Delphi-based implementation of my own NEAT (NeuroEvolution of Augmenting Topologies) method for evolving increasingly complex neural networks.

The concept behind NBGA is simple: A neural network can be evolved to draw a picture. The neural network receives as input (1) the x-position of the pen, (2) the y-position of the pen, and (3) the distance of the pen from the center of the drawing-space. The network is dragged over every pixel in the drawing space, one at a time, and flushed between each pixel (so it decides what to do independently for each point). At every pixel, the network spends some time processing the input (it can use recurrent connections), and finally outputs an ink level for that point. After doing this operation for every pixel, an image has been specified.

The evolution in NBGA is interactive; the user decides which images he or she prefers by clicking on them in a simple interface, shown here:

When the user is satisfied with the selection(s), he or she can click "New Generation" and the chosen images are mated and mutated to produce a new set of images. This breeding process is repeated indefinitely, as long as the user likes.

Here's the interesting part: Recall that each image is drawn by a neural network. In that sense, the images are indirectly encoded, i.e. the pixel values are not directly stored in the genome. Rather, the "genome" is a neural network that indirectly represents the image as a functional mapping. What's interesting about this is that this situation is roughly analogous to natural genetics, in which biological genes are indirectly mapped to the final phenotype.

Furthermore, NEAT is based on the idea that the networks in early generations start out small and simple, and complexify over generations by adding more structure through topological mutations. NBGA, being based on NEAT, follows this process. Thus, early images are generated by small, simple networks, and as networks become more complex, so do the images.

What the following evolutionary sequence shows is that this process of complexification has remarkable properties. Unbelievable features suddenly appear out of nowhere, such as tail fins and a cockpit! These discoveries are no trick; there is no prior knowledge about spaceships or airplanes built into NBGA. Rather, what these innovations demonstrate is that increasing the genetic complexity (i.e. adding new dimensions to the search space) adds new features to the phenotype, and sometimes these features make sense even though they are in effect the result of pure serendipity.

As you browse through the sequence below, notice how the networks complexify as new features appear. In a way, viewing this process gives a kind of novel intuition into how new character can appear in evolution, and how simple spaces can lead into more complex spaces with more features (which is a big part of the theory behind NEAT).

The last thing I need to tell you is how I evolved the spaceships. I bred them myself, selecting images that looked increasingly spaceship or airplane-like as they appeared over generations. The images are in order such that earlier images come from earlier generations; thus the entire sequence tells a story. One more thing that should be mentioned about NBGA is that it includes a "God Mode" that allows users to literally manipulate individual connection weight values for a chosen network and watch the resultant image morph before their eyes:

By the way, please excuse the little joke window title, "Ken's God Mode." It got this name because I requested this mode from Mattias, so he decided to (jokingly) name it after me.

Anyway, the God Mode means that the user can learn the meaning of individual connections and how they affect specific features in the image. I occasionally used God Mode to get some of the images below, for example to change wing patterns or change the length of the tail, though most changes, and all novel discoveries, are natural consequences of evolution.

I hope you enjoy this history as much as I did. I will try to insert some small commentary about what's interesting about each image. Remember to keep an eye on the networks as they become more complex.

First image: This is the first image I found that looked vaguely like a rocket. Notice the simple generating network.

Interestingly, this new rocket is a direct descendant of the previous image, giving a sense of how the underlying features of a phenotype can be surprisingly flexible while still preserving an overall theme.

A new node has been added to the network. Notice that there are now more features in the front of the ship.

Wing "decorations" appear! Notice the tail streaks off into infinity.

This ship is a sibling of the previous one. It is possible to identify individual features and how they vary between the two siblings.

Here is another close relative of the previous two, with some butterfly-like characteristics.

Back to the main lineage: A new node has appeared, and with it are new wing decorations.

More new nodes and the body has split in this variant.

Back to the main lineage. The wings are further elaborating.

More interesting wing variation using "God Mode." It's amazing how much sensible variation you can get, still preserving the general "spaceship" character. It gives you a sense of how nature can produce so many forms based on the same underlying body plan.

A remarkable innovation has taken place: A coherent tail has finally appeared!

A long-tailed relative of the previous individual. Interestingly, this variant was produced by maniuplating a single weight in the network, the "tail weight."

A split-body relative of the previous two individuals. It is interesting that "body-split" is a distinct dimension of variation that remains available even as the forms complexify.

Back to the regular lineage, the tail has been elaborated to end in two points rather than a single rounded bulb.

Playing with God Mode, I altered the wing configuration of the previous individual.

Another wing style variant on the previous two images.

Surprisingly, this pod-like image is a close relative of the recent individuals. It just shows how much flexibility there is in the overall spaceship theme that has been evolved into the genome over many generations by now.

Another surprisingly different-looking close relative. It looks like a missile blasting off, but if you look closely, it has the main features of its predecessors.

Back to the main lineage, a new feature has appeared: lateral wing exhaust (look back to see that there was none before).

This image exhibits perhaps the most amazing and unexpected innovation of all: tail fins! What's amazing is that NBGA has no prior knowledge of tail fins- they just naturally appeared out of the blue. So if it seems strange that arms would just evolve out of nowehere over the course of biological evolution- this is how it can happen.

A variant of the previous individual. New wing design.

Another remarkable innovation: a cockpit has appeared!

Check out the new aerodynamic tail-fin design, courtesy of natural selection.

This spaceship has new decorations up front and a new tail configuration.

Thank you for stopping by. Please feel free to contact me here: Kenneth O. Stanley 2004-12-10 | Homepage (includes demos, software, FAQ, all publications)

Thank you to Mattias Fagerlund for producing NBGA and for implementing "God Mode."