Tuesday, November 28, 2006

Final Thoughts

This course is almost finished, just one more day to go which is today's class! Well, when I first started out, my interest in art got me to sign up for the course and A.I. just sounds cool. I think, this whole blog idea really worked throughout the course and I wouldn't suggest anything better to display our case presentations.

As for the first few weeks of the course, I think it started well and I enjoyed the artwork we created in class. Weekly reflections and case studies were getting into me but I should have expected this as it is a 70% coursework. Anyways, I would suggest, for the reflections that we could have different questions every 2 weeks or so, just to help us get more inspired to write more :P

Can't wait for the rest of the class presentations and most of them seem really interesting! Gd luck to everyone!

Genetic Algorithm and Art



Biography

Michael Gold is President of Microgold Software Inc., makers of the WithClass UML Tool. His company is a Microsoft VBA Partner and Borland Partner. He has a BSEE and MEng EE from Cornell University and has consulted for Chase Manhattan Bank, Merrill Lynch. Currently, he is a senior consultant at JP Morgan Bank. He has been involved in several .NET book projects, and is currently working on a book for using .NET with embedded systems

What is Genetic Algorithm?

As defined from Wikipedia.org, genetic algorithm is “is a search technique used in computing to find true or approximate solutions to optimization and search problems, and is often abbreviated as GA. Genetic algorithms are categorized as global search heuristics. Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover (also called recombination).”


A number of people in the art world are experimenting with what is known as evolutionary art and even sold a few of their works. Basically, genetic Art is a subset of evolutionary art and uses genetic algorithms to generate the art.

Computing Process

Michael has created this art to show and provide the users a head start on preparing their own art one day with genetic algorithm. He create his art using C# and .NET. He has experimented a bit with genetic algorithms and creating fitness functions that produce art on a Windows Form.

The basic idea behind creating art from mathematical equations, is to produce a color from a formula operating on an x,y coordinate. (In three dimensions you would produce a color from an (x,y,z) coordinate.). In the given art, Michael has
geared up formulas to produce 4 possible colors from results ranging from 0-3.

The first dataset for comparing our art was derived from the simple formula is (a + b) mod 4. This formula forces all the simulated results to values between 0 and 3 The genetic algorithm will produce genes that try to converge on a formula that approximates the formula. It is better that the algorithm not converge to the correct answer (a+b) mod 4, because the approximation to the formula is what produces the original art.

Here are some examples of the above code in resulting artworks produced after 1000 generations of converging on the formula.

Simply, multiplying the above formula [(a * b) mod 4], you can see the following result. This is a bit more sophisticated than the first example.

And finally, Micheal has also powered b to a [(a^b) mod 4] and this will give the most complicated art of them all. Changing the color scheme a bit, by producing a different set of colors from the results of (0-4) and running the algorithm on a 1000 generations against the ab mod 5 data, we get the art textures


public void Plot(Form1 TheForm, Graphics g)
{
// Fill the whole form with a light gray color to erase old drawing
g.FillRectangle(Brushes.LightGray, TheForm.ClientRectangle);

// go through each x,y coordinate and plug it into the equation
// produced by the genome to derive an integer representing a
// color
for (int i = 0; i < color="blue">
for (int j = 0; j < color="blue">
double calc1 = PerformCalculation(i, j); // do calculation
if (calc1 > 4)
g.DrawLine(Pens.LightBlue, i, j, i+1, j);

else if (calc1 > 3)
g.DrawLine(Pens.Purple, i, j, i, j+1);

else if (calc1 > 2)
g.DrawLine(Pens.Red, i, j, i+1, j);

else if (calc1 > 1)
g.DrawLine(Pens.Yellow, i, j, i, j+1);

else
g.DrawLine(Pens.Navy, i, j, i+1, j);
}
}

The data points for the fitness function ab mod 5 are shown in listing 2a. The first 2 numbers in each triple set are a and b respectively. The last number is the resulting value of the equation ab mod 5.


Comparison

Comparing the above pieces of artwork done by Micheal Gold, I would rate the most recent one the highest because I believe it has more varity and color combinations than the rest. The more complicated the equation or formula maybe, the better output it will have, even though it may take much longer to process. The final picture also has the best effect than the others as it creates a flow of colors and lines.

References: Micheal Site, Wikipedia

Tuesday, November 07, 2006

C.E.B. Reas

Biography

C.E.B. Reas is an artist and educator living and working in Los Angeles. His work employs ideas explored in conceptual and minimal artworks as focused through the programming concepts that he created for his artwork. He exhibits, performs, and lectures in the US, Asia, and Europe. As an associate professor in the Design Media Arts department at UCLA, Reas interacts with undergraduate and graduate students. His classes provide a foundation for thinking about software as a medium for visual exploration. In 2004, he has also done a selected workshop at City University of Hong Kong called “Processing Workshop”

Artist Statement

"Systems have been the core of my work for the last twelve years and for the last six years I’ve been creating dynamic systems in software. I work in two areas: organic systems and conceptual systems. The organic systems are derived from my interest in artificial life and the phenomenon of emergence. The conceptual systems are more formal and explore the nature of software, representation, notation, and process. I’m fascinated with the way temporal and logical processes are encoded and decoded through symbols. "


Computing Process

Tissue Type A-002002Archival Epson paper with archival Epson inks1 with AP, signed11"x14"

One of Reas famous work is the “Tissue.” So what exactly is the “Tissue?” Tissue exposes the movements of independent software machines. Tissue is an example of software creating a fluid and gives an unexpected interaction rather than more typical strict and mathematical constructions. For this particular piece of artwork, it didn’t mention about the software he has used to develop the art. However, for his other artworks, he mainly uses C/C++, OpenGL and JAVA. He has created 28 prints from the program he has created.

Each line in the image reveals the path of each machine's movement as it responds to surrounding in its environment. The process consists of simple layers of code combine to create a complicated behavior of these machines. Each machine has two software sensors which determine the distance from each of its sensors to the first stimulus point as indicated in the code below. This helps to detect the environment and two software actuators (actuator is the mechanism by which an agent acts upon an environment) to propel itself.

dx = stimulusX - leftSensorX;
dy = stimulusY - leftSensorY;
leftDistance = sqrt(dx*dx + dy*dy);
dx = stimulusX - rightSensorX;
dy = stimulusY - rightSensorY;
rightDistance = sqrt(dx*dx + dy*dy);


According to the above code, the sensors and actuators determine the specific behavior for each machine. Creating thousands of simultaneously running software machines, there are five types of behavior each specified with a color. These are:

  • Variable speed
  • Direction
  • Position of movement
  • Size
  • Turning rate

  • Also stated with this type of behavior are the constraints in which, when they hit the edge, they reverse direction, for example. Each machine continually alters its direction and speed by analyzing its position in relation to the environment. The software then normalizes the two distance measurements, “leftDistance” and “rightDistance”, and compresses the values between 0.0 and 1.0. The resulting values are input into a nonlinear function, returned, and saved. These two new values are averaged and stored into a variable called “normSensorAverage:”

    normSensorLeft = leftDistance/maxDistance;
    normSensorRight = rightDistance/maxDistance;
    normSensorLeft = hump(normSensorLeft);
    normSensorRight = hump(normSensorRight);
    normSensorAverage = (normSensorLeft + normSensorRight) / 2.0;

    The speed of the machine is then modified using the value of “normSensorAverage” and the constant value “maxSpeed,” which is the maximum speed that a machine is capable of reaching:

    speed = speed + (maxSpeed - (maxSpeed * normSensorAverage));

    The new speed and position are updated based on the same calculations are made for each additional stimulus and then the X and Y positions. These calculations occur for each of the thousands of machines that are simultaneously displayed on the screen.

    Tissue Type A-022002Archival Epson paper with archival Epson inks1 with AP, signed11"x14"


    Tissue Type A-012002Archival Epson paper with archival Epson inks1 with AP, signed11"x14"

    Analysis / Comparison

    The artwork of Rhea has been displayed at some art museums such as process/drawing, a show of recent and new works opening 1 october 2005 at [Digital Art Museum] in Berlin. So I would like to compare the above two artwork. With similar color patterns and lines, I actually like both of the above art not becuase of their similarities but of the overall outlook. The second artwork has more color expression whereas the first one has a better flow of art (integrated from top to bottom).

    More examples of Rhea's Artwork:

    Process 8


    Process 6

    Reference: Rhea's Site, Interview