Evolutionary Artwork: Replacing a human fitness function with one that approximates desired aesthetic qualities.

Quick links: flickr reference images | Kandid results (GECCO poster) (page 2) | results (histogram method, 100x75) | results (color count method, 100x75) | results (histogram method, 320x240) | paper (word format)

The basic idea behind this project was to take a bunch of the most popular Flickr images and generate artwork with a program that compares the colors of the generated images to the colors of the popular Flickr images. I used a genetic algorithm to "breed" images by finding the "high fitness" individuals (those with colors closely resembling Flickr images) and "breeding" them with other high fitness individuals. Weak individuals are discarded, and the strong individuals survive. Mutation is also performed by the algorithm - this causes random operations or functions to be performed on some individuals in the population. I used 177 Flickr photos, each representing the most interesting photo from one of 177 days. You can see all the reference photos by clicking this link.

I used two different techniques to generate artwork. The first applies a sequence of basic image operations, such as: adjust brightness, adjust contrast, change hue, change saturation, blur, emboss, convert to grayscale, gamma correction, etc. These operations are performed on an input image. Images created this way end up looking quite abstract. Here is an example of an image undergoing these operations:

Image operations performed on an input image. From left to right: original image, MinimumFilter applied with window height/width of 11 pixels, Invert applied, NormalizeHistogram applied on Blue channel.

The second technique is based on the Genetic Art applet created by Jerry Huxtable (Huxtable). His applet shows you variations of a randomly generated image. You click on the one you like the best, and the applet generates more variations based on your selection. Jerry was kind enough to lend me the source code to the applet so I could make a version of his program that doesn't require user input - I can run many populations doing the Flickr color comparisons to try to pluck out the best matches. Here are some examples of images generated by his program:

Sample images generated by Jerry Huxtable's Genetic Art applet.

Below is a small sampling of results generated by the genetic algorithm, using a fitness function based on color distribution histograms (the fitness function is what separates the "strong" individuals from the "weak" individuals):

Sample of generative artwork of high fitness, using the color distribution histogram fitness function. The leftmost images are reference Flickr images. To their right are samples of their closest-matching images. There are two rows per Flickr image. The first row contains images created by the Operations technique. The second row contains images created by the Huxtable technique. Fitness values are displayed under each image. Lower fitness values indicate high-fitness individuals. Most high-fitness individuals contain color distributions that closely resemble their corresponding reference image.

You can see all of the results by clicking this link. The size of generated images is 100x75; larger images are much slower to generate. I did manage to experiment with larger sizes. View the 320x240 results by clicking this link.

I tried a second fitness function that computes an eight-byte array of color counts by category (red, cyan, blue, magenta, yellow, black, white, and green). The results are a bit different; I prefer these results over the ones created by the histogram-based fitness function. Below is a small sampling of these results:

Generative artwork created using the color count vector fitness function in both the Operations technique and the Huxtable technique. Left-most column contains Flickr reference images.

You can see all of the results using this color counting technique by clicking this link. The size of generated images is 100x75.

Click this link to download the paper I wrote about this project for my Genetic Algorithms course.


Here are some sample results from recent experiments using Kandid to try to match color distributions against a selection of Flickr images:

The noteworthy result is that there is more variety generated by the Kandid genetic art framework, and it produces some interesting color matches to the Flickr images. For more info on recent results presented at GECCO 2007, have a look at Kandid results (GECCO poster) and Kandid results (poster page 2)