Mandelbrot Genetics


by Jeffrey Ventrella www.Ventrella.com



Read the Chapter:
Evolving the Mandelbrot Set
to Imitate Figurative Art

in this book



What the hell is this black thing? It looks like a squashed bug in the road. It's quite ugly in fact. But wait a minute. Hold on. It's not ugly. Look more closely.

The images below are high magnifications of the boundary of this thing that we thought was just a squashed bug. They are colorized to make it easier to see the many levels of fractal self-similarity. Because of this endless variety of form, this thing - the Mandelbrot Set - has been called the most complex object in mathematics.

So, depending on how you look at this thing, it can be quite beautiful. In fact, I might even say it's a little bit too beautiful. All this Psychedelic Baroque - it makes me want to do something subversive.
As a young art student, I had a huge appetite for abstract expressionism and surrealism. I would gaze at the paintings of Francis Bacon, Robert Motherwell, and Arshile Gorky . I would marvel at their ability to mix beauty and ugliness in a way that forced my brain to see the world more clearly - more intensely. These artists would paint forms that lay somewhere between abstraction and representation. Gymnastics for the eye-brain system.
Perhaps because the Mandelbrot Set is rather ungainly (when seen in its whole, rendered in black, as it often is) my curiosity was aroused.

When considered as a tool for visual expression, I think the Mandelbrot equation has not yet sufficiently been given a good workout - tweaked, molded, deconstructed - using the tools of visual language. To embrace the Mandelbrot Set is to fall in love with the simplicity behind its incomprehensible complexity. And in doing so, an artist can lose the sense of irreverence that is sometimes necessary to pull something out of context and expand its vocabulary into a new domain. I decided that this would make an interesting challenge. This thing that is so thoroughly complex, exhibiting organization and variety as to create near religious admiration by mathematicians and novices alike - what a great candidate for the subversive act. The Big Tweak.


Epiphany
My discovery of fractal geometry revealed for me a whole new kind of code for the complexity of nature. It initially pulled me out of the visual language space, and caused me to pontificate on the nature of Numbers, the nature of Nature, and the way complexity comes into being. After the hangover of an intoxicating love-affair, I realized that something deeper than mathematical elegance had to be explored.

Fractal Geometry tells us something about process. And this process might in fact have something in common with human creativity and art-making. Thus began a journey for me in discovering ways to use this rich medium for visual expression, where visual language and mathematical language are merged as a single poetic form.

Genetic Code
The Mandelbrot equation is z = z2 + c, where z and c are complex numbers and c is a location in the complex plane being tested. The function is applied many times, with the output value of z from each iteration being used as input for the next iteration. During iteration, if the value of z exceeds a magnitude of 2, then iteration halts and we declare that location in c as outside of the Mandelbrot Set (white). Otherwise, c lies inside of the Set (black).

If the function were iterated only once at each c, the result would be a round shape, analogous to a single cell before subdividing into a multicelullar organism. Each time the function is iterated, the approximation of the Set becomes more refined, and the boundary reveals more bays and peninsulas. Fractal self-similarity increases.




If instead of squaring the value of z, you cube it (z = z3 + c), the result is the form shown here.

Many variations on the function have been explored, and the result is many kinds of "Mandelbrot Sets". These show how much variation there is in the world of iteration in the complex plane. Fractal explorers such as Clifford Pickover have created some pretty cool variations.



In order to implement the Mandelbrot function in a normal programming language, you have to handle the real and imaginary parts of the complex equation, and thus, you end up with code like what is shown below. The exposure of these real number variables sets up the conditions for the subversive act - an act that pulls the equation out of the realm of complex analysis, and tweaks the Mandelbrot Set in ways that are less mathematically understandable, yet visually evocative.

The Mandelbrot Set


Genetic Visual Language
As a part of the fractal journey that began in the mid 80's, I had generated a large series of images of a specific treatment of the Mandelbrot equation, resulting in a variety of organic, gestural forms. See my Mandeltweak web page for more examples.


My total mutilation of the equation caused a mathematician who specialized in the Set to disregard my explorations as completely outside of any legitimate analysis from the standpoint of Complex Analysis.

I took this as a sign that I was on the right track, and continued to mutilate the equation, exposing more and more parameters that enabled visual treatment, each parameter representing an adjective - a descriptor - of some visual concept. Little did I know that my irreverence to the mathematics would ultimately make me appreciate it more.
Everything Spins in the Complex Plane
Multiplication of two complex numbers results in rotation in the plane. This may account for the many circular and curvilinear features in the Set. Curiously, even when the function is genetically tweaked as to pull it out of the realm of complex numbers, it still maintains some of the spinning dynamics, as indicated by many of the remote magnifications of these tweaks.


Multidimensional Genetic Space
The relationships between these genetic variations is intriguing, similar to the way Richard Dawkins originally described the biomorphs in his Blind Watchmaker program. Dawkins' notion of a "Genetic Space" inspired me to create an art piece that was displayed at Galery Naga in Boston.

To distinguish my Mandelbrot Art from what so many others were doing (Psychedelic Baroque) I decided to forget about color entirely, and render my images in GRAY-SCALE. Its all about form - morphology.


Using a Genetic Algorithm
Any time you have a set of computer-generated images whose variety can be encoded as a large set of parameters, you have a good candidate for using a genetic algorithm to search the large space of possible images. So I used a variation on the genetic algorithm to interactively search for cool artworks.

Then a question came up: what if I used an image (say, an image of my face) as a fitness metric, to find out if the Mandelbrot Set could be coerced into taking on the appearance of my face? So I developed a way to compare a 50x50-pixel Mandeltweak to a 50x50-pixel image of my face. I then generated a population of Mandeltweaks, each based on a unique genome. A genetic algorithm was used to find Mandeltweaks that most closely-approach the likeness of my face.

The fact that the Mandeltweaks were not able to accurately approach my likeness, and the fact that they have their own genetic signature, which is not at all human - this made for some strange images - looking like a human head at first glance, but upon closer inspection, showing a non-human genetic signature.



Convergence
The scheme is as follows: A population of genomes is created, which starts out completely random. Then, random genomes are chosen from the pool to mate and create an offspring, using crossover. The offspring genotype is used to generate a new Mandeltweak, which is compared to the ideal image and given a fitness value. The new offspring replaces the least-fit individual in the population. This process is repeated many times. Over time, the average fitness increases, as well as the similarity to the ideal image.

It's interesting to note that even though it is common for a Mandeltweak to reach around 90% correspondence (using a pixel-by-pixel comparison between the Mandeltweak and the ideal image), we (humans) can easily tell that these do not look like faces - much less like my face. There are two main reasons: (1) the limitations of the Mandeltweak to visually imitate anything accurately, and (2) the fact that we (humans) have such sensitive facial recognition abilities.




Mandeltweaks have particular attributes that make them unable to evolve to emulate all possible images - although they can approximate certain images to some degree. This brings to mind the plasticity of the phenotype space of real-world organisms. No amount of dog breeding would ever create the likeness of a jellyfish. And certainly there is no way you could breed a dog to look like an icosadodecahedron.


Running Tests
I ran some tests to see how much my Mandeltweak system could converge on recognizable shapes. I included a special tweak based on "Mandelbrot cubed" (which includes many more genes) to see if its larger phenotype space would have any more imitative abilities. And I found that it didn't. Also, since the comparison algorithm does not consider image 'features', many of the distinctive aspects of the image were not picked up, such as eyes, legs, and fingers. And it wasn't able to imitate Mickey Mouse's face, which might be good, since I don't want to get sued by Disney.


Imitating...the Mandelbrot Set?
I ran one test to see if the Mandeltweak system could find its 'mother'. Surprisingly, several tests I ran could not converge on it - even though the Mandelbrot Set exists in this phenotype space. But it tried! The illustration below shows that the population was able to approach the form of the Set, but the most-fit tweak ended up being rotated almost 180 degrees in the wrong direction, and it formed a proboscis that it used to mimic the period-2 bulb of the Set.



I had a suspicion that the "angle gene" - the one that allows a Mandeltweak to have any arbitrary rotation - was the culprit. So I clamped that gene to keep the whole population of tweaks at the default oriention, and ran another test. It quickly found its mother. Everyone was happy.
Consilience
In March '09, the three tweaks below, will be exhibited at the Pence Art Gallery in Davis, California, as a photographic trilogy called, "Fractal Self Portrait".



Here is the accompanying statement to this work:

Math is an unlikely medium for self-portraiture. But I have a special relationship with the Mandelbrot Set - regarded as the most complex object in mathematics. It is a magic piece of clay - pregnant with infinite form. I have tried to coerce it into imitating images of my face, using a genetic algorithm technique that I developed. The fractal details are re-adapted into face-like features. From a distance, one sees references to human heads. But there are obvious signs of a genetic signature that is not human. This is a methodology of genetic mimesis - inspired by evolutionary biology.
In March of 2009 I began developing higher-resolution images. These are shown below. Click to see an enlarged image (warning - it might take a long time to download).



Find Way
In the fall of 2009, five images were exhibited in the show, Find Way at Point B Studio
in Port Orford, Oregon. Here is a snapshot of the gallery space.

What's Next?
There's a gazillion ideas for what can be done with the Mandelbrot Set. I've had a few dreams about the Set. My favorite dream was when I was in a boat, traveling along the shimmering shores of Mandelbrot Island. It was all blue and green and white. I could see its inlets, bays, coral reefs, mountains, and rocky cliffs. The breaking of the waves was of course fractal - Mandelbrot in every detail. It was very colorful and shimmering. It was a happy dream.

Magic Clay
I can imagine a haptic user interface allowing artists to build in a virtual art medium - something like a 3D extension of Magic Mandeltweak Clay. Its genetic signature would show through at every squish and squash. Forming shapes would not be plastic in the sense that normal clay is plastic. It would push back with its own rules of formation. An artform that is not completely giving, but fights back - this causes a tension that makes the artmaking process more challenging, and at the same time, reveals the wonderful properties of the mathematics behind it.

That's how I see the Mandelbrot Set and its infinite family tree of tweaked cousins - living in the underworld, beneath the Platonic world of Complex Math.


JJ Ventrella - March, 2009